Index: /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc	(revision 8927)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc	(revision 8928)
@@ -36,4 +36,5 @@
 #include "SpaceRace.h"
 
+
 namespace orxonox
 {
@@ -60,5 +61,5 @@
               //  this->nextcheckpoints_[i]->destroy();
         }
-        nextcheckpoints_.clear();
+       //nextcheckpoints_.destroy;
     }
 
@@ -69,8 +70,17 @@
         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
         assert(gametype);
-        if (this->getCheckpointIndex() == gametype->getCheckpointsReached())
-            this->setRadarVisibility(true);
-        else
-            this->setRadarVisibility(false);
+        this->setRadarVisibility(false);
+        Vector3 v =Vector3(0,0,0);
+        int j=0;
+        for (std::map<PlayerInfo*, Player>::iterator it = gametype->players_.begin(); it != gametype->players_.end(); ++it)
+        {
+        	j=gametype->getCheckpointReached(it->first);
+        	RaceCheckPoint* r=SpaceRaceManager::getCheckpoint(j);
+        	v=r->getNextcheckpoint();
+        	for(int i=1;i<4;i++){
+        	if (this->getCheckpointIndex() == v[i])
+           	 this->setRadarVisibility(true);
+           	 }
+        }     
     }
 
@@ -82,13 +92,15 @@
         XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
         XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
-    //XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,const std::vector<int>&);
+    XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,const Vector3&);
     }
 
-    void RaceCheckPoint::triggered(bool bIsTriggered)
+
+
+    void RaceCheckPoint::triggered(bool bIsTriggered, PlayerInfo* player)
     {
         DistanceTrigger::triggered(bIsTriggered);
 
         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
-        if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered)
+        if (gametype && this->getCheckpointIndex() == gametype->getCheckpointReached(player) && bIsTriggered)
         {
             gametype->clock_.capture();
@@ -103,5 +115,5 @@
             else
             {
-                gametype->newCheckpointReached();
+                gametype->newCheckpointReached(this);
                 this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
             }
Index: /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h	(revision 8927)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h	(revision 8928)
@@ -50,7 +50,17 @@
             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_; }
 
-            protected:
-            virtual void triggered(bool bIsTriggered);
+	inline void setNextcheckpoint(const Vector3& 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_;}
+        protected:
+            virtual void triggered(bool bIsTriggered, PlayerInfo* player);
             inline void setLast(bool isLast)
                 { this->bIsLast_ = isLast; }
@@ -58,13 +68,7 @@
                 { return this->bIsLast_; }
             
-	inline void setCheckpointIndex(int checkpointIndex)
-                { this->bCheckpointIndex_ = checkpointIndex; }
-            inline int getCheckpointIndex()
-                { return this->bCheckpointIndex_; }
+	
+            	
 
-	inline void setNextcheckpoint(std::vector<int> checkpoints)
-                { this->nextcheckpoints_ = checkpoints; }
-            inline std::vector<int> getNextcheckpoint()
-                { return this->nextcheckpoints_; }
             virtual void setTimelimit(float timeLimit);
             inline float getTimeLimit()
@@ -78,5 +82,6 @@
             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.
 
-	std::vector<int> nextcheckpoints_; //the indexes of the next check points
+	
+	Vector3 nextcheckpoints_; //the indexes of the next check points
       
     };
Index: /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc	(revision 8927)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc	(revision 8928)
@@ -45,8 +45,10 @@
     {
         RegisterObject(SpaceRace);
-        this->checkpointsReached_ = 0;
+        //this->checkpointsReached_ = 0;
         this->bTimeIsUp_ = false;
         this->numberOfBots_ = 0;
         this->cantMove_=false;
+        
+       
     }
     
@@ -65,6 +67,5 @@
             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"
-                        + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1)
-                        + " before the time limit. You lose!";
+                        + "You didn't reach the check point  before the time limit. You lose!";
             const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
             ChatManager::message(message);
@@ -138,16 +139,36 @@
 	
 
-    void SpaceRace::newCheckpointReached()
+    void SpaceRace::newCheckpointReached(RaceCheckPoint* p)
     {
-        this->checkpointsReached_++;
+        this->checkpointReached_=p->getCheckpointIndex();
         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>(this->getCheckpointsReached())
+        const std::string& message = "Checkpoint " + multi_cast<std::string>(p)
                         + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
                         + " seconds.";
         const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
         ChatManager::message(message);
+        
+       
     }
+    
+     int SpaceRace::getCheckpointReached(PlayerInfo* player){
+    	return this->currentCheckpoint_[player];
+}
 
+void SpaceRace::playerEntered(PlayerInfo* player){
+    	this->currentCheckpoint_[player]=1;
+    	this->playersAlive_++;
+    }
+    
+	bool SpaceRace::playerLeft(PlayerInfo* player){
+		 bool valid_player = true;
+        if (valid_player)
+        {
+            this->playersAlive_--;
+        }
+
+        return valid_player;
+	}
 }
Index: /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h	(revision 8927)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h	(revision 8928)
@@ -59,22 +59,33 @@
             virtual void end();
 		
-            virtual void newCheckpointReached();
+            virtual void newCheckpointReached(RaceCheckPoint* p);
 
-            inline void setCheckpointsReached(int n)
-                { this->checkpointsReached_ = n;}
-            inline int getCheckpointsReached()
-                { return this->checkpointsReached_; }
+            inline void setCheckpointReached(int n)
+                { this->checkpointReached_ = n;}
+            inline int getCheckpointReached()
+                { return this->checkpointReached_; }
+		
             inline void timeIsUp()
                 { this->bTimeIsUp_ = true;}
 	void tick(float dt);
+
+	int getCheckpointReached(PlayerInfo* player);
+
+	 
         protected:
-		
+		virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
+		 virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables.
         private:
 	float maxSpeedBack_; float maxSpeedFront_; float maxSpeedLeftRight_; float maxSpeedUpDown_; 
 	bool cantMove_;
-            int checkpointsReached_; //The current number of check points reached by the player.
+            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.
             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.
+
+		std::map<PlayerInfo*, int> currentCheckpoint_;
+		int playersAlive_;
+
+	
     };
 }
Index: /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc	(revision 8927)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc	(revision 8928)
@@ -85,6 +85,8 @@
     
     
+    
+   
+    
+    }
 
-    
 
-}
Index: /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h	(revision 8927)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h	(revision 8928)
@@ -61,4 +61,6 @@
             void addCheckpoint(RaceCheckPoint* checkpoint);
             RaceCheckPoint* getCheckpoint(unsigned int index) const;
+		
+		
 
 	void tick(float dt);
@@ -66,5 +68,8 @@
 		
         private:
-	std::vector<RaceCheckPoint*> checkpoints_;
+		std::vector<RaceCheckPoint*> checkpoints_;
+ 		
+		
+		
  };
 }
