pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2460 - trunk/src/worldobjs


From: David Philippi at BerliOS
Subject: [Pingus-CVS] r2460 - trunk/src/worldobjs
Date: Wed, 12 Oct 2005 12:09:04 +0200

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]