Index: code/trunk/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.cc	(revision 9259)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.cc	(revision 9260)
@@ -42,15 +42,13 @@
 {
     CreateFactory(RaceCheckPoint);
-    
-     
 
     RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceMultiTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
     {
         RegisterObject(RaceCheckPoint);
+
         this->setDistance(100);
         this->setBeaconMode("off");
         this->setBroadcast(false);
         this->setSimultaneousTriggerers(100);
-        this->bTimeLimit_ = 0;
 
         this->setRadarObjectColour(ColourValue::Blue);
@@ -58,62 +56,49 @@
         this->setRadarVisibility(false);
         this->settingsChanged();
-        this->reached_=NULL;
-      
+
+        this->checkpointIndex_ = 0;
+        this->nextcheckpoints_ = Vector3::ZERO;
+        this->bIsLast_ = false;
+        this->timeLimit_ = 0;
+        this->player_ = NULL;
     }
-    
+
 
    RaceCheckPoint::~RaceCheckPoint()
    {
-    
    }
-
-    void RaceCheckPoint::tick(float dt)
-    {
-        SUPER(RaceCheckPoint, tick, dt);
-
-        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
-        assert(gametype);
-    }
 
     void RaceCheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(RaceCheckPoint, XMLPort, xmlelement, mode);
-        Vector3 v= Vector3(0,0,0);
+
         XMLPortParam(RaceCheckPoint, "checkpointindex", setCheckpointIndex, getCheckpointIndex, xmlelement, mode).defaultValues(0);
-        XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
+        XMLPortParam(RaceCheckPoint, "islast", setLast, isLast, xmlelement, mode).defaultValues(false);
         XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
-    XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,const Vector3&).defaultValues(v);
+        XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode, const Vector3&).defaultValues(Vector3::ZERO);
     }
 
-    void RaceCheckPoint::fire(bool bIsTriggered,BaseObject* player)
+    void RaceCheckPoint::fire(bool bIsTriggered, BaseObject* originator)
     {
-        DistanceMultiTrigger::fire((bool)bIsTriggered,player);
-        
-        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
-        assert(gametype);
-        ControllableEntity* entity = (ControllableEntity*) player;
-     
-        PlayerInfo* player2 = entity->getPlayer();
-     
-        if(bIsTriggered)
-            this->reached_=player2;
+        DistanceMultiTrigger::fire(bIsTriggered, originator);
+
+        if (bIsTriggered)
+        {
+            ControllableEntity* entity = orxonox_cast<ControllableEntity*>(originator);
+            if (entity)
+                this->player_ = entity->getPlayer();
+        }
     }
 
     void RaceCheckPoint::setTimelimit(float timeLimit)
     {
-        this->bTimeLimit_ = timeLimit;
-        if (this->bTimeLimit_ != 0)
+        this->timeLimit_ = timeLimit;
+        if (this->timeLimit_ != 0)
         {
-            SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
-            assert(gametype);
-            if (gametype)
-            {
-                const std::string& message =  "You have " + multi_cast<std::string>(this->bTimeLimit_)
-                            + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1);
-                const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);
-                ChatManager::message(message);
-            }
+            std::string message =  "You have " + multi_cast<std::string>(this->timeLimit_)
+                        + " seconds to reach the check point " + multi_cast<std::string>(this->checkpointIndex_ + 1);
+            const_cast<GametypeInfo*>(this->getGametype()->getGametypeInfo())->sendAnnounceMessage(message);
+            ChatManager::message(message);
         }
     }
-
 }
Index: code/trunk/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.h	(revision 9259)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.h	(revision 9260)
@@ -31,7 +31,4 @@
 
 #include "gametypes/GametypesPrereqs.h"
-
-
-
 #include "objects/triggers/DistanceMultiTrigger.h"
 #include "interfaces/RadarViewable.h"
@@ -42,5 +39,5 @@
     @brief
         The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
-         Don't forget to control the indexes of your check points and to set one last check point
+        Don't forget to control the indexes of your check points and to set one last check point
     */
     class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
@@ -51,39 +48,43 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void tick(float dt);
+
             inline void setCheckpointIndex(int checkpointIndex)
-                { this->bCheckpointIndex_ = checkpointIndex; }
-            inline int getCheckpointIndex()
-                { return this->bCheckpointIndex_; }
+                { this->checkpointIndex_ = checkpointIndex; }
+            inline int getCheckpointIndex() const
+                { return this->checkpointIndex_; }
 
             inline void setNextcheckpoint(const Vector3& checkpoints)
-                { this->nextcheckpoints_=checkpoints; }
+                { this->nextcheckpoints_ = checkpoints; }
             inline void setNextcheckpoint(float x, float y, float z)
                 { this->setNextcheckpoint(Vector3(x, y, z)); }
             inline const Vector3& getNextcheckpoint() const
                 { return this->nextcheckpoints_; }
+
             inline void setLast(bool isLast)
                 { this->bIsLast_ = isLast; }
-            inline bool getLast()
+            inline bool isLast() const
                 { return this->bIsLast_; }
 
-            bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
-            float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
-            PlayerInfo* reached_;
-                
-            inline float getTimeLimit()
-                { return this->bTimeLimit_; }
-    
+            virtual void setTimelimit(float timeLimit);
+            inline float getTimeLimit() const
+                { return this->timeLimit_; }
+
+            inline PlayerInfo* getPlayer() const
+                { return this->player_; }
+            inline void resetPlayer()
+                { this->player_ = NULL; }
+
         protected:
-            virtual void fire(bool bIsTriggered,BaseObject* player);
-            virtual void setTimelimit(float timeLimit);
-            
+            virtual void fire(bool bIsTriggered, BaseObject* originator);
+
             inline const WorldEntity* getWorldEntity() const
                 { return this; }
 
         private:
-            int bCheckpointIndex_; //The index of this check point. The race starts with the check point with the index 0
-            Vector3 nextcheckpoints_; //the indexes of the next check points
-            
+            int checkpointIndex_;     ///< The index of this check point. The race starts with the check point with the index 0
+            Vector3 nextcheckpoints_; ///< the indexes of the next check points
+            bool bIsLast_;            ///< True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
+            float timeLimit_;         ///< The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
+            PlayerInfo* player_;      ///< The player that reached the checkpoint
     };
 }
Index: code/trunk/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.cc	(revision 9259)
+++ code/trunk/src/modules/gametypes/SpaceRace.cc	(revision 9260)
@@ -29,5 +29,4 @@
 #include "SpaceRace.h"
 
-
 #include "items/Engine.h"
 
@@ -46,15 +45,8 @@
     {
         RegisterObject(SpaceRace);
-        
+
+        this->cantMove_ = false;
         this->bTimeIsUp_ = false;
-        this->numberOfBots_ = 0;
-        this->cantMove_=false;
-        
     }
-       
-    
-  // void SpaceRace::SetConfigValues(){
-    //SUPER(Gametype,setConfigValues);
-    //this->Gametype::SetConfigValue(initialStartCountdown_, 3.0f);}
 
     void SpaceRace::end()
@@ -62,117 +54,73 @@
         this->Gametype::end();
 
+        this->clock_.capture();
+        int s = this->clock_.getSeconds();
+        int ms = static_cast<int>(this->clock_.getMilliseconds() - 1000*s);
+        std::string message;
+
         if (this->bTimeIsUp_)
         {
-            this->clock_.capture();
-            int s = this->clock_.getSeconds();
-            int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
-            const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
+            message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
                         + "You didn't reach the check point  before the time limit. You lose!";
-            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-            ChatManager::message(message);
         }
         else
         {
-            this->clock_.capture();
-            int s = this->clock_.getSeconds();
-            int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
-            const std::string& message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
+            message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
                         + "." + multi_cast<std::string>(ms) + " seconds.";
-            const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-            ChatManager::message(message);
+        }
 
-            float time = this->clock_.getSecondsPrecise();
-            this->scores_.insert(time);
-            std::set<float>::iterator it;
-            
-
-        }
+        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+        ChatManager::message(message);
     }
 
     void SpaceRace::start()
     {
+        this->spawnPlayersIfRequested();
+        Gametype::checkStart();
+        this->cantMove_ = true;
 
-        this->spawnPlayersIfRequested();
-        Gametype::checkStart(); 
-        this->cantMove_=true; 
-        
-        for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it) 
-        {
+        for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
             it->setActive(false);
-            
-        } 
-        this->addBots(this->numberOfBots_); 
+
+        this->addBots(this->numberOfBots_);
     }
-    
+
     void SpaceRace::tick(float dt)
     {
         SUPER(SpaceRace,tick,dt);
-    
-        if(!this->isStartCountdownRunning() && this->cantMove_)
+
+        if (!this->isStartCountdownRunning() && this->cantMove_)
         {
-            for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it) 
-            { 
+            for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
                 it->setActive(true);
-                
-            }
+
             this->cantMove_= false;
-            
-            std::string message("The match has started! Reach the check points as quickly as possible!");
+
+            std::string message = "The match has started! Reach the check points as quickly as possible!";
             const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-            ChatManager::message(message);            
+            ChatManager::message(message);
         }
-   
     }
 
-    
-    
-    void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl)
+    void SpaceRace::newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player)
     {
-        this->checkpointReached_[pl]=index;
+        int index = checkpoint->getCheckpointIndex();
+        this->checkpointReached_[player] = index;
         this->clock_.capture();
         int s = this->clock_.getSeconds();
-        int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
+        int ms = this->clock_.getMilliseconds() % 1000;
         const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
-            + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
-            + " seconds.";// Message is too long for a normal screen.
+            + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds.";
         const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
         ChatManager::message(message);
     }
-   
-    void SpaceRace::newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl)
-    {   
-        int index = p->getCheckpointIndex();
-        this->checkpointReached_[pl]=index;
-        this->clock_.capture();
-        int s = this->clock_.getSeconds();
-        int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);
-        const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
-            + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
-            + " seconds.";
-        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-        ChatManager::message(message);
-    }
-        
-    
+
     void SpaceRace::playerEntered(PlayerInfo* player)
     {
         Gametype::playerEntered(player);
-    
-        this->checkpointReached_[player]=-1;
-        //this->playersAlive_++;
+
+        this->checkpointReached_[player] = -1;
     }
-    
-    bool SpaceRace::playerLeft(PlayerInfo* player)
-    {
-        return Gametype::playerLeft(player);
-        // bool valid_player = true;
-        //if (valid_player)
-       // {
-        //    this->playersAlive_--;
-        //}
 
-       // return valid_player;
-    }
-    
     bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator)
     {
Index: code/trunk/src/modules/gametypes/SpaceRace.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.h	(revision 9259)
+++ code/trunk/src/modules/gametypes/SpaceRace.h	(revision 9260)
@@ -44,12 +44,12 @@
 namespace orxonox
 {
-  /**
-  @brief
-    The SpaceRace class enables the creation of a space race level, where the player has to reach check points in a given order.
-  */
+    /**
+    @brief
+        The SpaceRace class enables the creation of a space race level, where the player has to reach check points in a given order.
+    */
     class _GametypesExport SpaceRace : public Gametype
     {
         friend class RaceCheckPoint;
-       
+
 
         public:
@@ -57,36 +57,34 @@
             virtual ~SpaceRace() {}
 
+            void tick(float dt);
+
             virtual void start();
             virtual void end();
 
-            virtual void newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl);
-            virtual void newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl);
+            virtual void newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player);
 
-            inline void setCheckpointReached(int n, PlayerInfo* p)
-                { this->checkpointReached_[p] = n;}
-            inline int getCheckpointReached(PlayerInfo* p)
-                { return this->checkpointReached_[p]; }
+            inline void setCheckpointReached(int index, PlayerInfo* player)
+                { this->checkpointReached_[player] = index;}
+            inline int getCheckpointReached(PlayerInfo* player)
+                { return this->checkpointReached_[player]; }
 
-            inline void timeIsUp()
+            inline void setTimeIsUp()
                 { this->bTimeIsUp_ = true;}
-            void tick(float dt);
-            Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
-
+            inline Clock& getClock()
+                { return this->clock_; }
 
             bool allowPawnHit(Pawn* victim, Pawn* originator);
+            bool allowPawnDamage(Pawn* victim, Pawn* originator);
+            bool allowPawnDeath(Pawn* victim, Pawn* originator);
 
-            bool allowPawnDamage(Pawn* victim, Pawn* originator);
+        protected:
+            virtual void playerEntered(PlayerInfo* player); ///< Initializes values.
 
-            bool allowPawnDeath(Pawn* victim, Pawn* originator);
-        protected:
-            virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
-            virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables.
         private:
             bool cantMove_;
-            std::map<PlayerInfo*, int>checkpointReached_; //The number of the last check point reached by each player.
-            std::set<float> scores_; //The times of the players are saved in a set.
-            bool bTimeIsUp_; //True if one of the check points is reached too late.
-            
-            int playersAlive_;
+            std::map<PlayerInfo*, int> checkpointReached_; ///< The number of the last check point reached by each player.
+            bool bTimeIsUp_;                               ///< True if one of the check points is reached too late.
+
+            Clock clock_; ///< The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
     };
 }
Index: code/trunk/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.cc	(revision 9259)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.cc	(revision 9260)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *     Celine Eggenberger
+ *      Celine Eggenberger
  *   Co-authors:
  *      ...
@@ -47,18 +47,38 @@
     {
         RegisterObject(SpaceRaceManager);
-         
-        this->firstcheckpointvisible_=false;
-         
+
+        this->firstcheckpointvisible_ = false;
     }
 
     SpaceRaceManager::~SpaceRaceManager()
     {
-        if (this->isInitialized())
+        for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+            this->checkpoints_[i]->destroy();
+    }
+
+    void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(SpaceRaceManager, XMLPort, xmlelement, mode);
+
+        XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint,  xmlelement, mode);
+    }
+
+    void SpaceRaceManager::tick(float dt)
+    {
+        SUPER(SpaceRaceManager,tick,dt);
+
+        if (this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
         {
-            for (size_t i = 0; i < this->checkpoints_.size(); ++i)
-                this->checkpoints_[i]->destroy();
+            this->checkpoints_[0]->setRadarVisibility(true);
+            this->firstcheckpointvisible_ = true;
+        }
+
+        for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+        {
+            if (this->checkpoints_[i]->getPlayer() != NULL)
+                this->checkpointReached(this->checkpoints_[i], this->checkpoints_[i]->getPlayer());
         }
     }
-   
+
     void SpaceRaceManager::addCheckpoint(RaceCheckPoint* checkpoint)
     {
@@ -73,123 +93,92 @@
             return 0;
     }
-    
-    int SpaceRaceManager::getIndex(RaceCheckPoint* r) 
+
+    int SpaceRaceManager::getIndex(RaceCheckPoint* checkpoint)
     {
         for (size_t i = 0; i < this->checkpoints_.size(); ++i)
-            if (this->checkpoints_[i]==r) {return i;}
-           
+            if (this->checkpoints_[i] == checkpoint)
+                return i;
+
         return -1;
     }
-    
-    void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(SpaceRaceManager, XMLPort, xmlelement, mode);
 
-        
-        XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint,  xmlelement, mode);
-    }
-    
-    void SpaceRaceManager::tick(float dt)
-    {
-        SUPER(SpaceRaceManager,tick,dt);
-     
-        if(this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
-        {
-            this->checkpoints_[0]->setRadarVisibility(true);
-            this->firstcheckpointvisible_=true;
-        }
-         
-        for (size_t i = 0; i < this->checkpoints_.size(); ++i)
-        {
-            if(this->checkpoints_[i]->reached_!=NULL)
-                this->checkpointReached(this->checkpoints_[i],this->checkpoints_[i]->reached_);
-        }
-    }
-    
-    
     void SpaceRaceManager::checkpointReached(RaceCheckPoint* check, PlayerInfo* player)
     {
         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
         assert(gametype);
-        
-        bool b =false;    
-            
-        int index=gametype->getCheckpointReached(player);
-        Vector3 v=Vector3 (-1,-1,-1);
-        if (index>-1)
+
+        bool reachedValidCheckpoint = false;
+
+        int index = gametype->getCheckpointReached(player);
+        if (index > -1)
         {
-            RaceCheckPoint* tmp= this->getCheckpoint(index);
-            v= tmp->getNextcheckpoint();
-       
+            Vector3 v = this->getCheckpoint(index)->getNextcheckpoint();
+
             if (this->getCheckpoint(v.x) == check)
             {
-                b = true;
-            }    
-       
+                reachedValidCheckpoint = true;
+            }
             if (this->getCheckpoint(v.y) == check)
             {
-                b = true;
-            }    
+                reachedValidCheckpoint = true;
+            }
             if (this->getCheckpoint(v.z) == check)
             {
-                b = true;
-            }    
+                reachedValidCheckpoint = true;
+            }
         }
         else
         {
-            b = (this->getIndex(check) == 0);
+            reachedValidCheckpoint = (this->getIndex(check) == 0);
         }
-            
-        if (gametype && b)
+
+        if (gametype && reachedValidCheckpoint)
         {
-            gametype->clock_.capture();
-            float time = gametype->clock_.getSecondsPrecise();
-            if (check->getTimeLimit()!=0 && time > check->getTimeLimit())
+            gametype->getClock().capture();
+            float time = gametype->getClock().getSecondsPrecise();
+            if (check->getTimeLimit() != 0 && time > check->getTimeLimit())
             {
-                gametype->timeIsUp();
+                gametype->setTimeIsUp();
                 gametype->end();
             }
-            else if (check->getLast())
+            else if (check->isLast())
                 gametype->end();
             else
-				{
-                if (index > -1)this->setRadVis(player,false);
-                	else this->getCheckpoint(0)->setRadarVisibility(false);
-                gametype->newCheckpointReached(check,player);
-               
-                
+			{
+                if (index > -1)
+                    this->setRadVis(player, false);
+                else
+                    this->getCheckpoint(0)->setRadarVisibility(false);
+
+                gametype->newCheckpointReached(check, player);
                 this->setRadVis(player, true);
             }
         }
-        check->reached_=NULL;
+
+        check->resetPlayer();
     }
-    
-    void SpaceRaceManager::setRadVis(PlayerInfo* player, bool b)
+
+    void SpaceRaceManager::setRadVis(PlayerInfo* player, bool bVisible)
     {
         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
         assert(gametype);
         int index = gametype->getCheckpointReached(player);
-        Vector3 v = Vector3(-1,-1,-1);
-        RaceCheckPoint* tmp = this->getCheckpoint(index);
-        v = tmp->getNextcheckpoint();
-    
-        if(v.x > -1)
+        Vector3 v = this->getCheckpoint(index)->getNextcheckpoint();
+
+        if (v.x > -1)
         {
-            this->getCheckpoint(v.x)->setRadarVisibility(b);
+            this->getCheckpoint(v.x)->setRadarVisibility(bVisible);
             this->getCheckpoint(v.x)->settingsChanged();
         }
-        if(v.y > -1)
+        if (v.y > -1)
         {
-            this->getCheckpoint(v.y)->setRadarVisibility(b);
+            this->getCheckpoint(v.y)->setRadarVisibility(bVisible);
             this->getCheckpoint(v.y)->settingsChanged();
         }
-        if(v.z > -1)
+        if (v.z > -1)
         {
-            this->getCheckpoint(v.z)->setRadarVisibility(b);
-           this->getCheckpoint(v.z)->settingsChanged();
+            this->getCheckpoint(v.z)->setRadarVisibility(bVisible);
+            this->getCheckpoint(v.z)->settingsChanged();
         }
-        
-        
     }
-    
 }
Index: code/trunk/src/modules/gametypes/SpaceRaceManager.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.h	(revision 9259)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.h	(revision 9260)
@@ -46,32 +46,32 @@
 namespace orxonox
 {
-  /**
-  @brief
-    The SpaceRaceManager class controls a space race level, where the player has to reach check points in a given order.
-  */
+    /**
+    @brief
+        The SpaceRaceManager class controls a space race level, where the player has to reach check points in a given order.
+    */
     class _GametypesExport SpaceRaceManager : public BaseObject, public Tickable
     {
         friend class RaceCheckPoint;
-    
+
         public:
             SpaceRaceManager(BaseObject* creator);
             virtual ~SpaceRaceManager() ;
 
-            void XMLPort(Element& xmlelement, XMLPort::Mode mode); 
-            int getIndex(RaceCheckPoint* r);
+            void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
             void addCheckpoint(RaceCheckPoint* checkpoint);
             RaceCheckPoint* getCheckpoint(unsigned int index) const;
-        
+            int getIndex(RaceCheckPoint* checkpoint);
+
             void checkpointReached(RaceCheckPoint* check, PlayerInfo* player);
-        
+
             void tick(float dt);
-    
+
         protected:
-            void setRadVis(PlayerInfo* player, bool b);//sets RadarVisibility of the checkpoints the player can reach.
-    
+            void setRadVis(PlayerInfo* player, bool bVisible); ///< sets RadarVisibility of the checkpoints the player can reach.
+
         private:
             std::vector<RaceCheckPoint*> checkpoints_;
-            bool firstcheckpointvisible_;//true if the first check point is visible.
-        
+            bool firstcheckpointvisible_; ///< true if the first check point is visible.
     };
 }
Index: code/trunk/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 9259)
+++ code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 9260)
@@ -123,5 +123,5 @@
         if (this->gtinfo_->isStartCountdownRunning() && !this->gtinfo_->hasStarted())
             this->gtinfo_->countdownStartCountdown(dt);
-			
+
         if (!this->gtinfo_->hasStarted())
         {
@@ -131,7 +131,6 @@
                 if(it->first->isHumanPlayer() && it->first->isReadyToSpawn())
                     this->gtinfo_->playerReadyToSpawn(it->first);
-                   
-                
-            }
+            }
+
             this->checkStart();
         }
@@ -144,5 +143,4 @@
     void Gametype::start()
     {
-         
         this->addBots(this->numberOfBots_);
 
@@ -150,6 +148,4 @@
 
         this->spawnPlayersIfRequested();
-        
-        
     }
 
@@ -401,5 +397,5 @@
                             hashumanplayers = true;
                     }
-                         
+
                     if (allplayersready && hashumanplayers)
                     {
@@ -413,5 +409,4 @@
                 }
             }
-            
         }
     }
Index: code/trunk/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.h	(revision 9259)
+++ code/trunk/src/orxonox/gametypes/Gametype.h	(revision 9260)
@@ -152,8 +152,7 @@
             virtual void resetTimer();
             virtual void resetTimer(float t);
-            inline unsigned int getNumberOfPlayers()
-              { return this->gtinfo_->getNumberOfPlayers(); }
 
-	
+            inline unsigned int getNumberOfPlayers() const
+                { return this->gtinfo_->getNumberOfPlayers(); }
 
         protected:
