pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/traps FakeExit.cc,1.19,1.20 LaserExit


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/traps FakeExit.cc,1.19,1.20 LaserExit.cc,1.19,1.20 hammer.cc,1.18,1.19 smasher.cc,1.33,1.34
Date: 9 Jun 2002 00:56:28 -0000

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

Modified Files:
        FakeExit.cc LaserExit.cc hammer.cc smasher.cc 
Log Message:
- replaced shared_ptr<PinguAction> with PinguAction*
- this commit is incomplete, it compiles, but segfault at level startup, will 
fix that tomorrow if I find the bug

Index: FakeExit.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/traps/FakeExit.cc,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- FakeExit.cc 8 Jun 2002 16:08:16 -0000       1.19
+++ FakeExit.cc 9 Jun 2002 00:56:26 -0000       1.20
@@ -71,7 +71,7 @@
       }
 
       if (counter >= 3 && counter <= 5) {
-       pingu->set_action(PinguActionFactory::instance ()->create_sp 
("smashed"));
+       pingu->set_action(PinguActionFactory::instance ()->create ("smashed"));
       }
     }
 }

Index: LaserExit.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/traps/LaserExit.cc,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- LaserExit.cc        8 Jun 2002 16:08:16 -0000       1.19
+++ LaserExit.cc        9 Jun 2002 00:56:26 -0000       1.20
@@ -49,7 +49,7 @@
 
   PinguHolder* holder = world->get_pingu_p ();
   for (PinguIter pingu = holder->begin (); pingu != holder->end (); ++pingu){
-       catch_pingu(*pingu);
+    catch_pingu(*pingu);
   }
 
   if (killing) {
@@ -68,16 +68,18 @@
   //if (!pingu->is_alive())
   //return;
 
-  if (!killing) {
-    if (pingu->get_x () < pos.x + 34 + 10 && pingu->get_x () > pos.x + 34 
-       && pingu->get_y () < pos.y + 43 + 20 && pingu->get_y () > pos.y + 43) 
-      {
-       if (!(pingu->get_action().get() && pingu->get_action()->get_name() == 
"LaserKill")) {
-         killing = true;
-         pingu->set_action(PinguActionFactory::instance ()->create_sp 
("laserkill"));
+  if (!killing) 
+    {
+      if (pingu->get_x () < pos.x + 34 + 10 && pingu->get_x () > pos.x + 34 
+         && pingu->get_y () < pos.y + 43 + 20 && pingu->get_y () > pos.y + 43) 
+       {
+         if (!(pingu->get_action() && pingu->get_action()->get_name() == 
"LaserKill")) 
+           {
+             killing = true;
+             pingu->set_action(PinguActionFactory::instance ()->create 
("laserkill"));
+           }
        }
-      }
-  }
+    }
 }
 
 /* EOF */

Index: hammer.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/traps/hammer.cc,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- hammer.cc   8 Jun 2002 16:08:16 -0000       1.18
+++ hammer.cc   9 Jun 2002 00:56:26 -0000       1.19
@@ -70,7 +70,7 @@
   if (counter >= (int)(surface.get_num_frames()) - 3) {
     if (pingu->get_x() > pos.x + 55 && pingu->get_x() < pos.x + 77
        && pingu->get_y() > pos.y + 146 && pingu->get_y() < pos.y + 185)
-      pingu->set_action(PinguActionFactory::instance ()->create_sp 
("smashed"));
+      pingu->set_action(PinguActionFactory::instance ()->create ("smashed"));
   }
 }
 

Index: smasher.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/traps/smasher.cc,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- smasher.cc  8 Jun 2002 23:11:09 -0000       1.33
+++ smasher.cc  9 Jun 2002 00:56:26 -0000       1.34
@@ -28,8 +28,7 @@
 #include "../actions/Splashed.hh"
 #include "../algo.hh"
 #include "smasher.hh"
-
-using boost::shared_ptr;
+#include "../PinguActionFactory.hh"
 
 Smasher::Smasher(const TrapData& data)
 {
@@ -74,7 +73,7 @@
                  if ((*pingu)->is_inside (int(pos.x + 30), int(pos.y + 90),
                                           int(pos.x + 250), int(pos.y + 190)))
                    {
-                     (*pingu)->set_action (shared_ptr<PinguAction>(new 
Splashed ()));
+                     (*pingu)->set_action (PinguActionFactory::instance 
()->create ("splashed"));
                    }
                }
            }




reply via email to

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