[Orxonox-commit 5066] r9730 - code/trunk/src/orxonox/gametypes

jo at orxonox.net jo at orxonox.net
Thu Oct 31 22:25:41 CET 2013


Author: jo
Date: 2013-10-31 22:25:40 +0100 (Thu, 31 Oct 2013)
New Revision: 9730

Modified:
   code/trunk/src/orxonox/gametypes/Mission.cc
Log:
Making the setLives function more flexible. The game can be immediately ended by setting the lives to zero.

Modified: code/trunk/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Mission.cc	2013-10-31 21:18:39 UTC (rev 9729)
+++ code/trunk/src/orxonox/gametypes/Mission.cc	2013-10-31 21:25:40 UTC (rev 9730)
@@ -60,6 +60,11 @@
             this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
             this->end();
         }
+        else if (this->lives_ == 0)
+        {
+            this->missionAccomplished_ = false;
+            this->end();
+        }
     }
 
     void Mission::pawnKilled(Pawn* victim, Pawn* killer)
@@ -67,11 +72,6 @@
         if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer() )
         {
             this->lives_--;
-            if (this->lives_ == 0)
-            {
-                this->missionAccomplished_ = false;
-                this->end();
-            }
         }
     }
 




More information about the Orxonox-commit mailing list