Index: code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc	(revision 8934)
+++ code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc	(revision 8940)
@@ -45,5 +45,5 @@
 
         this->bCheckpointIndex_ = 0;
-        this->bIsLast_ = false;
+        //this->bIsLast_ = false;
         this->bTimeLimit_ = 0;
         this->isVisible_=false;
@@ -90,9 +90,9 @@
     {
         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, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
-    XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,const Vector3&);
+    XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,const Vector3&).defaultValues(v);
     }
 
@@ -102,4 +102,5 @@
 
         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+        assert(gametype);
         if (gametype && this->getCheckpointIndex() == gametype->getCheckpointReached(player) && bIsTriggered)
         {
@@ -115,5 +116,5 @@
             else
             {
-                gametype->newCheckpointReached(this);
+                gametype->newCheckpointReached(this,player);
                 this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
             }
@@ -127,4 +128,5 @@
         {
             SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+            assert(gametype);
             if (gametype)
             {
Index: code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h	(revision 8934)
+++ code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h	(revision 8940)
@@ -62,5 +62,5 @@
 		{return this->nextcheckpoints_;}
 
-	inline void setVisibility(bool b)
+	inline void setV(bool b)
 		{this->isVisible_ = b;}
         protected:
Index: code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc	(revision 8934)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc	(revision 8940)
@@ -45,10 +45,11 @@
     {
         RegisterObject(SpaceRace);
-        this->checkpointReached_ = 0;
+        
         this->bTimeIsUp_ = false;
         this->numberOfBots_ = 0;
         this->cantMove_=false;
         
-       
+       for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {this->checkpointReached_[it->first]=0;}
     }
     
@@ -136,10 +137,22 @@
     }
 
-	
-	
-
-    void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index)
-    {
-        this->checkpointReached_=index;
+	void SpaceRace::setV(SpaceRaceManager* m){
+		Vector3 v =Vector3(0,0,0);
+        int j=0;
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {
+        	j=this->getCheckpointReached(it->first);
+        	RaceCheckPoint* r=m->getCheckpoint(j);
+        	v=r->getNextcheckpoint();
+        	for(int i=1;i<4;i++){
+        	 RaceCheckPoint* n=m->getCheckpoint(i);
+           	 n->setV(true);
+           	 }
+	}
+	}
+
+    void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl)
+    {
+        this->checkpointReached_[pl]=index;
         this->clock_.capture();
         int s = this->clock_.getSeconds();
@@ -154,7 +167,7 @@
     }
     
-     void SpaceRace::newCheckpointReached(RaceCheckPoint* p)
+     void SpaceRace::newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl)
     {	int index = p->getCheckpointIndex();
-        this->checkpointReached_=index;
+        this->checkpointReached_[pl]=index;
         this->clock_.capture();
         int s = this->clock_.getSeconds();
@@ -169,10 +182,8 @@
     }
     
-     int SpaceRace::getCheckpointReached(PlayerInfo* player){
-    	return this->currentCheckpoint_[player];
-}
+    
 
 void SpaceRace::playerEntered(PlayerInfo* player){
-    	this->currentCheckpoint_[player]=1;
+    	this->checkpointReached_[player]=0;
     	this->playersAlive_++;
     }
Index: code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h	(revision 8934)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h	(revision 8940)
@@ -53,5 +53,5 @@
     {
         friend class RaceCheckPoint;
-	friend class SpaceRaceManager;
+	//friend class SpaceRaceManager;
 
         public:
@@ -62,11 +62,11 @@
             virtual void end();
 		
-            virtual void newCheckpointReached(SpaceRaceManager* p, int index);
-		virtual void newCheckpointReached(RaceCheckPoint* p);
+            virtual void newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl);
+		virtual void newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl);
 
-            inline void setCheckpointReached(int n)
-                { this->checkpointReached_ = n;}
-            inline int getCheckpointReached()
-                { return this->checkpointReached_; }
+            inline void setCheckpointReached(int n, PlayerInfo* p)
+                { this->checkpointReached_[p] = n;}
+            inline int getCheckpointReached(PlayerInfo* p)
+                { return this->checkpointReached_[p]; }
 		
             inline void timeIsUp()
@@ -74,7 +74,6 @@
 	void tick(float dt);
 
-	int getCheckpointReached(PlayerInfo* player);
 
-	 
+	 void setV(SpaceRaceManager* m);
         protected:
 		virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
@@ -83,10 +82,10 @@
 	float maxSpeedBack_; float maxSpeedFront_; float maxSpeedLeftRight_; float maxSpeedUpDown_; 
 	bool cantMove_;
-            int checkpointReached_; //The number of the last check point reached by each player.
+            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.
             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 8934)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc	(revision 8940)
@@ -29,4 +29,5 @@
 #include "SpaceRaceManager.h"
 #include "SpaceRace.h"
+#include "infos/PlayerInfo.h"
 
 #include "core/XMLPort.h"
@@ -39,5 +40,5 @@
 namespace orxonox
 {
-    CreateUnloadableFactory(SpaceRaceManager);
+    CreateFactory(SpaceRaceManager);
 
     SpaceRaceManager::SpaceRaceManager(BaseObject* creator) : BaseObject(creator)
@@ -74,5 +75,5 @@
 
         //XMLPortParam(WaypointController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
-        //XMLPortObject(WaypointController, WorldEntity, "waypoints", addWaypoint, getWaypoint,  xmlelement, mode);
+        XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint,  xmlelement, mode);
     }
     
@@ -81,16 +82,7 @@
     SUPER(SpaceRaceManager,tick,dt);
      SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
-           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=this->getCheckpoint(j);
-        	v=r->getNextcheckpoint();
-        	for(int i=1;i<4;i++){
-        	 RaceCheckPoint* n=this->getCheckpoint(i);
-           	 n->setVisibility(true);
-           	 }
-    	}
+     gametype->setV(this);
+         
+    	
      
     }
Index: code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h	(revision 8934)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h	(revision 8940)
@@ -34,5 +34,5 @@
 #include <set>
 #include <string>
-# include <vector>
+#include <vector>
 
 #include <util/Clock.h>
