pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/worldobjs entrance.cxx,1.5,1.6


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjs entrance.cxx,1.5,1.6
Date: 4 Oct 2002 16:54:06 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/worldobjs
In directory dark:/tmp/cvs-serv3709/worldobjs

Modified Files:
        entrance.cxx 
Log Message:
cleaned up the whole goal condition section, worlds should exit now again

Index: entrance.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/entrance.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- entrance.cxx        4 Oct 2002 13:46:56 -0000       1.5
+++ entrance.cxx        4 Oct 2002 16:54:04 -0000       1.6
@@ -67,48 +67,51 @@
 
   Pingu* pingu = world->get_pingus()->create_pingu(data->pos, data->owner_id);
 
-  switch (data->direction) 
+  if (pingu) // still pingus in the pool 
     {
-    case WorldObjsData::EntranceData::LEFT:
-      d.left();
-      pingu->set_direction(d);
-      break;
+      switch (data->direction) 
+        {
+        case WorldObjsData::EntranceData::LEFT:
+          d.left();
+          pingu->set_direction(d);
+          break;
 
-    case WorldObjsData::EntranceData::MISC:
-      if (last_direction) 
-       {
-         d.left();
-         last_direction = 0;
-       } 
-      else
-       {
-         d.right();
-         last_direction = 1;
-       }
-      pingu->set_direction(d);
-      break;
+        case WorldObjsData::EntranceData::MISC:
+          if (last_direction) 
+            {
+              d.left();
+              last_direction = 0;
+            } 
+          else
+            {
+              d.right();
+              last_direction = 1;
+            }
+          pingu->set_direction(d);
+          break;
        
-    case WorldObjsData::EntranceData::RIGHT:  
-      d.right();
-      pingu->set_direction(d);
-      break;
+        case WorldObjsData::EntranceData::RIGHT:  
+          d.right();
+          pingu->set_direction(d);
+          break;
     
-    default:
-      std::cout << "Entrance:: Warning direction is wrong: " << 
data->direction << std::endl;
-      d.right();
-      pingu->set_direction(d);
-      break;
+        default:
+          std::cout << "Entrance:: Warning direction is wrong: " << 
data->direction << std::endl;
+          d.right();
+          pingu->set_direction(d);
+          break;
+        }
+    }
+  else
+    {
+      //std::cout << "Entrance: pingu couldn't get created" << std::endl;
     }
-
 }
 
 void
 Entrance::update ()
 {
-  if (   pingu_ready() 
-         && (world->get_pingus()->get_number_of_released() 
-             < static_cast<int>(world->get_allowed_pingus()))
-      && (! world->check_armageddon()))
+  if (pingu_ready() && (! world->check_armageddon()))
     {
       create_pingu();
     }





reply via email to

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