[Orxonox-commit 493] r3056 - trunk/src/orxonox/objects/gametypes

Aurelian at orxonox.net Aurelian at orxonox.net
Mon May 25 13:56:53 CEST 2009


Author: Aurelian
Date: 2009-05-25 13:56:53 +0200 (Mon, 25 May 2009)
New Revision: 3056

Modified:
   trunk/src/orxonox/objects/gametypes/Asteroids.cc
   trunk/src/orxonox/objects/gametypes/Asteroids.h
Log:
Bug in gametype Asteroids fixed: game ends directly after death

Modified: trunk/src/orxonox/objects/gametypes/Asteroids.cc
===================================================================
--- trunk/src/orxonox/objects/gametypes/Asteroids.cc	2009-05-25 11:53:13 UTC (rev 3055)
+++ trunk/src/orxonox/objects/gametypes/Asteroids.cc	2009-05-25 11:56:53 UTC (rev 3056)
@@ -43,7 +43,6 @@
     {
         RegisterObject(Asteroids);
         this->firstCheckpointReached_ = false;
-        this->firstTimeSpawned_ = false;
     }
 
     void Asteroids::tick(float dt)
@@ -61,16 +60,12 @@
         }
     }
 
-    void Asteroids::spawnPlayer(PlayerInfo* player)
+    void Asteroids::pawnKilled(Pawn* victim, Pawn* killer)
     {
-        if (this->timerIsActive_ && this->firstTimeSpawned_)
+        if (victim && victim->getPlayer())
         {
             this->end();
-            return;
         }
-
-        this->firstTimeSpawned_ = true;
-        Gametype::spawnPlayer(player);
     }
 
     void Asteroids::start()

Modified: trunk/src/orxonox/objects/gametypes/Asteroids.h
===================================================================
--- trunk/src/orxonox/objects/gametypes/Asteroids.h	2009-05-25 11:53:13 UTC (rev 3055)
+++ trunk/src/orxonox/objects/gametypes/Asteroids.h	2009-05-25 11:56:53 UTC (rev 3056)
@@ -50,13 +50,11 @@
               { this->firstCheckpointReached_ = reached; }
 
         protected:
-            virtual void spawnPlayer(PlayerInfo* player);
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
 
         private:
             bool firstCheckpointReached_;
             bool gameEnded_;
-            bool firstTimeSpawned_;
-
     };
 }
 




More information about the Orxonox-commit mailing list