[Orxonox-commit 4590] r9261 - in code/trunk/src: modules/gametypes orxonox/gametypes

landauf at orxonox.net landauf at orxonox.net
Sat Jun 2 22:46:25 CEST 2012


Author: landauf
Date: 2012-06-02 22:46:25 +0200 (Sat, 02 Jun 2012)
New Revision: 9261

Modified:
   code/trunk/src/modules/gametypes/SpaceRace.cc
   code/trunk/src/modules/gametypes/SpaceRace.h
   code/trunk/src/orxonox/gametypes/Gametype.cc
Log:
fixed start-countdown issue in spacerace

Modified: code/trunk/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.cc	2012-06-02 20:34:48 UTC (rev 9260)
+++ code/trunk/src/modules/gametypes/SpaceRace.cc	2012-06-02 20:46:25 UTC (rev 9261)
@@ -73,22 +73,19 @@
         ChatManager::message(message);
     }
 
-    void SpaceRace::start()
-    {
-        this->spawnPlayersIfRequested();
-        Gametype::checkStart();
-        this->cantMove_ = true;
-
-        for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
-            it->setActive(false);
-
-        this->addBots(this->numberOfBots_);
-    }
-
     void SpaceRace::tick(float dt)
     {
         SUPER(SpaceRace,tick,dt);
 
+        if (this->isStartCountdownRunning() && !this->cantMove_)
+        {
+            this->spawnPlayersIfRequested();
+            this->cantMove_ = true;
+
+            for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
+                it->setActive(false);
+        }
+
         if (!this->isStartCountdownRunning() && this->cantMove_)
         {
             for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)

Modified: code/trunk/src/modules/gametypes/SpaceRace.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.h	2012-06-02 20:34:48 UTC (rev 9260)
+++ code/trunk/src/modules/gametypes/SpaceRace.h	2012-06-02 20:46:25 UTC (rev 9261)
@@ -58,7 +58,6 @@
 
             void tick(float dt);
 
-            virtual void start();
             virtual void end();
 
             virtual void newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player);

Modified: code/trunk/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.cc	2012-06-02 20:34:48 UTC (rev 9260)
+++ code/trunk/src/orxonox/gametypes/Gametype.cc	2012-06-02 20:46:25 UTC (rev 9261)
@@ -403,8 +403,10 @@
                         if(Core::getInstance().inDevMode())
                             this->start();
                         else
+                        {
                             this->gtinfo_->setStartCountdown(this->initialStartCountdown_);
-                        this->gtinfo_->startStartCountdown();
+                            this->gtinfo_->startStartCountdown();
+                        }
                     }
                 }
             }




More information about the Orxonox-commit mailing list