Author: torangan
Date: 2005-10-12 12:09:03 +0200 (Wed, 12 Oct 2005)
New Revision: 2460
Modified:
trunk/src/worldobjs/exit.cxx
Log:
applied patch by Jason Green
Modified: trunk/src/worldobjs/exit.cxx
===================================================================
--- trunk/src/worldobjs/exit.cxx 2005-10-09 18:43:04 UTC (rev 2459)
+++ trunk/src/worldobjs/exit.cxx 2005-10-12 10:09:03 UTC (rev 2460)
@@ -91,18 +91,25 @@
PinguHolder* holder = world->get_pingus();
for (PinguIter pingu = holder->begin(); pingu != holder->end(); ++pingu)
+ {
+ // Make sure this particular exit is allowed for this pingu
+ if ((*pingu)->get_owner() == owner_id)
{
+ // Now, make sure the pingu is within range
if ( (*pingu)->get_x() > pos.x - 1 && (*pingu)->get_x() < pos.x + 1
- && (*pingu)->get_y() > pos.y - 5 && (*pingu)->get_y() < pos.y + 2)
- {
- if ( (*pingu)->get_status() != PS_EXITED
- && (*pingu)->get_status() != PS_DEAD
- && (*pingu)->get_action() != Actions::Exiter)
- {
- (*pingu)->set_action(Actions::Exiter);
- }
- }
+ && (*pingu)->get_y() > pos.y - 5 && (*pingu)->get_y() < pos.y
+ 2)
+ {
+ // Now, make sure the pingu isn't already exiting, gone, or dead
+ if ( (*pingu)->get_status() != PS_EXITED
+ && (*pingu)->get_status() != PS_DEAD
+ && (*pingu)->get_action() != Actions::Exiter)
+ {
+ // Pingu actually exits
+ (*pingu)->set_action(Actions::Exiter);
+ }
+ }
}
+ }
}
float
_______________________________________________
pingus-cvs mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/pingus-cvs