Index: code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.cc	(revision 8351)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.cc	(revision 8706)
@@ -151,12 +151,5 @@
                 //Give new pig boost
                 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
-                if (spaceship && spaceship->getEngine())
-                {
-                    spaceship->getEngine()->setSpeedFactor(5);
-                    WeakPtr<Engine>* ptr = new WeakPtr<Engine>(spaceship->getEngine());
-                    ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
-                    executor->setDefaultValue(0, ptr);
-                    new Timer(10, false, executor, true);
-                }
+                grantPigBoost(spaceship);
             }
 
@@ -252,13 +245,5 @@
                 //Give new pig boost
                 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
-                if (spaceship && spaceship->getEngine())
-                {
-                    spaceship->getEngine()->setSpeedFactor(5);
-                    WeakPtr<Engine>* ptr = new WeakPtr<Engine>(spaceship->getEngine());
-                    ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
-                    executor->setDefaultValue(0, ptr);
-                    new Timer(10, false, executor, true);
-                }
-
+                grantPigBoost(spaceship);
             }
             // killer vs piggy
@@ -321,4 +306,17 @@
     }
 
+    void Dynamicmatch::grantPigBoost(orxonox::SpaceShip* spaceship)
+    {
+        // Give pig boost
+        if (spaceship)
+        {
+            spaceship->setSpeedFactor(5);
+            WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
+            ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
+            executor->setDefaultValue(0, ptr);
+            new Timer(10, false, executor, true);
+        }
+    }
+
     void Dynamicmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn) //set party + colouring
     {
@@ -597,5 +595,5 @@
     }
 
-    void Dynamicmatch::resetSpeedFactor(WeakPtr<Engine>* ptr)// helper function
+    void Dynamicmatch::resetSpeedFactor(WeakPtr<SpaceShip>* ptr)// helper function
     {
         if (*ptr)
Index: code/trunk/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.h	(revision 8351)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.h	(revision 8706)
@@ -73,5 +73,6 @@
             virtual void furtherInstructions();*/
             virtual void rewardPig();
-            void resetSpeedFactor(WeakPtr<Engine>* ptr);
+            void grantPigBoost(SpaceShip* spaceship); // Added this, since it's used twice on different occasions.
+            void resetSpeedFactor(WeakPtr<SpaceShip>* ptr);
             void tick (float dt);// used to end the game
             SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
Index: code/trunk/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 8351)
+++ code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 8706)
@@ -121,10 +121,19 @@
         }
 
-        if (this->gtinfo_->bStartCountdownRunning_ && !this->gtinfo_->bStarted_)
-            this->gtinfo_->startCountdown_ -= dt;
-
-        if (!this->gtinfo_->bStarted_)
+        if (this->gtinfo_->isStartCountdownRunning() && !this->gtinfo_->hasStarted())
+            this->gtinfo_->countdownStartCountdown(dt);
+
+        if (!this->gtinfo_->hasStarted())
+        {
+            for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            {
+                // Inform the GametypeInfo that the player is ready to spawn.
+                if(it->first->isHumanPlayer() && it->first->isReadyToSpawn())
+                    this->gtinfo_->playerReadyToSpawn(it->first);
+            }
+                    
             this->checkStart();
-        else if (!this->gtinfo_->bEnded_)
+        }
+        else if (!this->gtinfo_->hasEnded())
             this->spawnDeadPlayersIfRequested();
 
@@ -136,5 +145,5 @@
         this->addBots(this->numberOfBots_);
 
-        this->gtinfo_->bStarted_ = true;
+        this->gtinfo_->start();
 
         this->spawnPlayersIfRequested();
@@ -143,5 +152,5 @@
     void Gametype::end()
     {
-        this->gtinfo_->bEnded_ = true;
+        this->gtinfo_->end();
 
         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
@@ -173,4 +182,5 @@
     {
         this->players_[player].state_ = PlayerState::Joined;
+        this->gtinfo_->playerEntered(player);
     }
 
@@ -270,4 +280,7 @@
                 }
 
+                if(victim->getPlayer()->isHumanPlayer())
+                    this->gtinfo_->pawnKilled(victim->getPlayer());
+
                 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
                 if (victim->getCamera())
@@ -306,10 +319,12 @@
     SpawnPoint* Gametype::getBestSpawnPoint(PlayerInfo* player) const
     {
+        // If there is at least one SpawnPoint.
         if (this->spawnpoints_.size() > 0)
         {
+            // Fallback spawn point if there is no active one, choose a random one.
             SpawnPoint* fallbackSpawnPoint = NULL;
             unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size())));
             unsigned int index = 0;
-            std::set<SpawnPoint*> activeSpawnPoints = this->spawnpoints_;
+            std::vector<SpawnPoint*> activeSpawnPoints;
             for (std::set<SpawnPoint*>::const_iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); ++it)
             {
@@ -317,20 +332,17 @@
                     fallbackSpawnPoint = (*it);
 
-                if (!(*it)->isActive())
-                    activeSpawnPoints.erase(*it);
+                if (*it != NULL && (*it)->isActive())
+                    activeSpawnPoints.push_back(*it);
 
                 ++index;
             }
 
-            randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size())));
-            index = 0;
-            for (std::set<SpawnPoint*>::const_iterator it = activeSpawnPoints.begin(); it != activeSpawnPoints.end(); ++it)
-            {
-                if (index == randomspawn)
-                    return (*it);
-
-                ++index;
-            }
-
+            if(activeSpawnPoints.size() > 0)
+            {
+                randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(activeSpawnPoints.size())));
+                return activeSpawnPoints[randomspawn];
+            }
+
+            COUT(2) << "Warning: Fallback SpawnPoint was used, because there were no active SpawnPoints." << endl;
             return fallbackSpawnPoint;
         }
@@ -346,5 +358,5 @@
                 it->second.state_ = PlayerState::Dead;
 
-                if (!it->first->isReadyToSpawn() || !this->gtinfo_->bStarted_)
+                if (!it->first->isReadyToSpawn() || !this->gtinfo_->hasStarted())
                 {
                     this->spawnPlayerAsDefaultPawn(it->first);
@@ -357,12 +369,12 @@
     void Gametype::checkStart()
     {
-        if (!this->gtinfo_->bStarted_)
-        {
-            if (this->gtinfo_->bStartCountdownRunning_)
-            {
-                if (this->gtinfo_->startCountdown_ <= 0)
-                {
-                    this->gtinfo_->bStartCountdownRunning_ = false;
-                    this->gtinfo_->startCountdown_ = 0;
+        if (!this->gtinfo_->hasStarted())
+        {
+            if (this->gtinfo_->isStartCountdownRunning())
+            {
+                if (this->gtinfo_->getStartCountdown() <= 0.0f)
+                {
+                    this->gtinfo_->stopStartCountdown();
+                    this->gtinfo_->setStartCountdown(0.0f);;
                     this->start();
                 }
@@ -389,8 +401,8 @@
                         // If in developer's mode, there is no start countdown.
                         if(Core::getInstance().inDevMode())
-                            this->gtinfo_->startCountdown_ = 0;
+                            this->start();
                         else
-                            this->gtinfo_->startCountdown_ = this->initialStartCountdown_;
-                        this->gtinfo_->bStartCountdownRunning_ = true;
+                            this->gtinfo_->setStartCountdown(this->initialStartCountdown_);
+                        this->gtinfo_->startStartCountdown();
                     }
                 }
@@ -402,6 +414,8 @@
     {
         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {
             if (it->first->isReadyToSpawn() || this->bForceSpawn_)
                 this->spawnPlayer(it->first);
+        }
     }
 
@@ -422,4 +436,8 @@
             player->startControl(spawnpoint->spawn());
             this->players_[player].state_ = PlayerState::Alive;
+
+            if(player->isHumanPlayer())
+                this->gtinfo_->playerSpawned(player);
+            
             this->playerPostSpawn(player);
         }
Index: code/trunk/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.h	(revision 8351)
+++ code/trunk/src/orxonox/gametypes/Gametype.h	(revision 8706)
@@ -78,7 +78,7 @@
 
             inline bool hasStarted() const
-                { return this->gtinfo_->bStarted_; }
+                { return this->gtinfo_->hasStarted(); }
             inline bool hasEnded() const
-                { return this->gtinfo_->bEnded_; }
+                { return this->gtinfo_->hasEnded(); }
 
             virtual void start();
@@ -114,12 +114,12 @@
 
             inline bool isStartCountdownRunning() const
-                { return this->gtinfo_->bStartCountdownRunning_; }
+                { return this->gtinfo_->isStartCountdownRunning(); }
             inline float getStartCountdown() const
-                { return this->gtinfo_->startCountdown_; }
+                { return this->gtinfo_->getStartCountdown(); }
 
             inline void setHUDTemplate(const std::string& name)
-                { this->gtinfo_->hudtemplate_ = name; }
+                { this->gtinfo_->setHUDTemplate(name); }
             inline const std::string& getHUDTemplate() const
-                { return this->gtinfo_->hudtemplate_; }
+                { return this->gtinfo_->getHUDTemplate(); }
 
             void addBots(unsigned int amount);
Index: code/trunk/src/orxonox/gametypes/LastTeamStanding.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/LastTeamStanding.cc	(revision 8351)
+++ code/trunk/src/orxonox/gametypes/LastTeamStanding.cc	(revision 8706)
@@ -55,8 +55,8 @@
         this->setHUDTemplate("lastTeamStandingHUD");
     }
-    
+
     LastTeamStanding::~LastTeamStanding()
     {
-    }   
+    }
 
     void LastTeamStanding::playerEntered(PlayerInfo* player)
@@ -69,10 +69,10 @@
         else
             playerLives_[player]=getMinLives();//new players only get minimum of lives */
-        
+
         this->timeToAct_[player] = timeRemaining;
         this->playerDelayTime_[player] = respawnDelay;
         this->inGame_[player] = true;
         unsigned int team = getTeam(player);
-        if( team < 0|| team > teams_) // make sure getTeam returns a regular value
+        if(team >= eachTeamsPlayers.size()) // make sure getTeam returns a regular value
             return;
         if(this->eachTeamsPlayers[team]==0) //if a player is the first in his group, a new team is alive
@@ -91,5 +91,5 @@
             this->inGame_.erase(player);
             unsigned int team = getTeam(player);
-            if( team < 0|| team > teams_) // make sure getTeam returns a regular value
+            if(team >= eachTeamsPlayers.size()) // make sure getTeam returns a regular value
                 return valid_player;
             this->eachTeamsPlayers[team]--;       // a player left the team
@@ -107,5 +107,5 @@
         bool allow = TeamDeathmatch::allowPawnDeath(victim, originator);
         if(!allow) {return allow;}
-        
+
         playerLives_[victim->getPlayer()] = playerLives_[victim->getPlayer()] - 1; //player lost a live
         this->inGame_[victim->getPlayer()] = false; //if player dies, he isn't allowed to respawn immediately
@@ -113,5 +113,5 @@
         {
             unsigned int team = getTeam(victim->getPlayer());
-            if(team < 0|| team > teams_) // make sure getTeam returns a regular value
+            if(team >= eachTeamsPlayers.size()) // make sure getTeam returns a regular value
                 return allow;
             this->eachTeamsPlayers[team]--;
@@ -140,5 +140,5 @@
                 const std::string& message = ""; // resets Camper-Warning-message
                 this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
-            }    
+            }
         }
         return allow;
@@ -163,8 +163,8 @@
             return;
         TeamDeathmatch::playerStartsControllingPawn(player,pawn);
-        
+
         this->timeToAct_[player] = timeRemaining + 3.0f + respawnDelay;//reset timer
         this->playerDelayTime_[player] = respawnDelay;
-        
+
         std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
         if (it != this->players_.end())
@@ -174,5 +174,5 @@
             const std::string& message = ""; // resets Camper-Warning-message
             this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
-        }  
+        }
     }
 
@@ -187,9 +187,9 @@
             }
             for (std::map<PlayerInfo*, float>::iterator it = this->timeToAct_.begin(); it != this->timeToAct_.end(); ++it)
-            {   
+            {
                 if (playerGetLives(it->first) <= 0)//Players without lives shouldn't be affected by time.
-                    continue;     
+                    continue;
                 it->second -= dt;//Decreases punishment time.
-                if (!inGame_[it->first])//Manages respawn delay - player is forced to respawn after the delaytime is used up. 
+                if (!inGame_[it->first])//Manages respawn delay - player is forced to respawn after the delaytime is used up.
                 {
                     playerDelayTime_[it->first] -= dt;
@@ -309,5 +309,5 @@
             return 0;
     }
-    
+
     void LastTeamStanding::setConfigValues()
     {
