Index: /code/branches/spaceraceTwo/data/levels/Spacerace2.oxw
===================================================================
--- /code/branches/spaceraceTwo/data/levels/Spacerace2.oxw	(revision 8967)
+++ /code/branches/spaceraceTwo/data/levels/Spacerace2.oxw	(revision 8968)
@@ -39,5 +39,5 @@
 	<SpaceRaceManager>
 <checkpoints>	
-	<RaceCheckPoint name="checkpoint1" position="0,-200,100" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false" nextcheckpoints=(1,2,0)>
+	<RaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false" nextcheckpoints="1,2,0">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
@@ -51,5 +51,5 @@
     </RaceCheckPoint>
 
-<RaceCheckPoint name="checkpoint2" position="0,-200,300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false" nextcheckpoints=(3,0,0)>
+<RaceCheckPoint name="checkpoint2" position="0,2100,2300" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false" nextcheckpoints="3,-1,-1">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
@@ -63,5 +63,5 @@
     </RaceCheckPoint>
 
-<RaceCheckPoint name="checkpoint3" position="0,-400,200" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false" nextcheckpoints=(3,0,0)>
+<RaceCheckPoint name="checkpoint3" position="0,700,2700" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
         <attached>
             <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
@@ -90,5 +90,18 @@
 
  
-
+<SpaceShip position="0,0,200" lookat="0,0,0">
+      <templates>
+        <Template link=spaceshipassff />
+      </templates>
+      <controller>
+        <WaypointPatrolController alertnessradius=1000 team=10>
+          <waypoints>
+            <Model mesh="cube.mesh" scale=8 position="0,-2000,1000" />
+            <Model mesh="cube.mesh" scale=8 position="0,2100,2300" />
+            <Model mesh="cube.mesh" scale=8 position="0,-400,300" />
+          </waypoints>
+        </WaypointPatrolController>
+      </controller>
+    </SpaceShip>
 
     <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 />
Index: /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc	(revision 8967)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc	(revision 8968)
@@ -35,4 +35,5 @@
 
 #include <infos/PlayerInfo.h>
+#include <worldentities/ControllableEntity.h>
 
 #include "SpaceRace.h"
@@ -56,10 +57,11 @@
         
         this->bTimeLimit_ = 0;
-        this->isVisible_=true;
+       
 
         this->setRadarObjectColour(ColourValue::Blue);
         this->setRadarObjectShape(RadarViewable::Triangle);
-        this->setRadarVisibility(true);
-    
+        
+    	this->setRadarVisibility(false);
+    	this->settingsChanged();
     	this->reached_=NULL;
     //this->addTarget("WorldEntity");
@@ -72,10 +74,7 @@
     {
     
-    	 if (this->isInitialized())
-        {
-           for (size_t i = 0; i < this->next_.size(); ++i)
-                this->next_[i]->destroy();
-        }
-       //nextcheckpoints_.destroy;
+    	
+        
+      
     }
 
@@ -86,23 +85,5 @@
         SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
         assert(gametype);
-        if(this->isVisible_){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);
-           	 }*/
-        //}     
     }
 
@@ -119,76 +100,13 @@
 	void RaceCheckPoint::fire(bool bIsTriggered,BaseObject* player)
     {
-    	
-    	//bool b= bIsTriggered;
-    	//PlayerInfo* pl= player;
     	DistanceMultiTrigger::fire((bool)bIsTriggered,player);
         
        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
         assert(gametype);
-        
-       
-        
-       // BaseObject b=*player;
-       //  PlayerInfo* p = orxonox_cast<PlayerInfo*,Player>(player);
-        //assert(player);
-       //PlayerInfo* player3=((PlayerInfo*) player);
-       Player* player3=((Player*) player);
-      
-      PlayerInfo* player2=( PlayerInfo*) player;
-       
-       for (std::map<PlayerInfo*, Player>::iterator it = gametype->players_.begin(); it != gametype->players_.end(); ++it)
-        {
-          unsigned int clientid1=0, clientid2=0,clientid3=0;
-          if(it->second.info_ !=NULL)clientid1 = it->second.info_->getClientID();else orxout()<<"second NULL"<<endl;
-           if(it->first !=NULL)clientid1 = it->first->getClientID();else orxout()<<"first NULL"<<endl;
-           clientid1 = it->first->getClientID();
-          if(player3 != NULL && player3->info_ != NULL)clientid2 =         player3->info_->getClientID();
-          if(player2 != NULL )clientid3 =         player2->getClientID();
-          orxout()<<clientid1<<endl;orxout()<<clientid2<<endl;orxout()<<clientid3<<endl;
-        orxout()<<"for"<<endl;if(clientid1==clientid2) {orxout()<<"player"<<endl; player2=it->first;}if((it->first)==player2) {orxout()<<"player2"<<endl; }}
-        
-        // PlayerInfo* player2 = orxonox_cast<PlayerInfo*>(player);
-       // assert(player);
-        //gametype->newCheckpointReached(this,player);
-        //if(bIsTriggered)this->reached_=player2;
-        
-        /* for (std::map<PlayerInfo*, Player>::iterator it = gametype->players_.begin(); it != gametype->players_.end(); ++it)
-        {if(gametype->getCheckpointReached(it->first)==-1) orxout()<<"index -1"<<endl;if(player2==it->first)orxout()<<"e"<<endl;}
-        if(gametype->getCheckpointReached(player2)==-1) orxout()<<"my index -1"<<endl;
-   orxout()<<gametype->getCheckpointReached(player2)<<endl;
-         
-        	
-        	RaceCheckPoint* check=gametype->getCheckpointReached(player2);
-        	
-        bool b =false;	
-        for(int i=0;i<3;i++){
-        
-        if (check->getNext[i]==this){
-        	b=true;}
-        }	
-       
-        	
-        if (gametype && b && bIsTriggered)
-        {
-            gametype->clock_.capture();
-            float time = gametype->clock_.getSecondsPrecise();
-            if (this->bTimeLimit_!=0 && time > this->bTimeLimit_)
-            {
-                gametype->timeIsUp();
-                gametype->end();
-            }
-            else if (this->getLast())
-                gametype->end();
-            else
-            	gametype->newCheckpointReached(this,player2)
-            {
-                
-                this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
-            }
-        }*/
-  
-		
-
-      
+     ControllableEntity* entity=(ControllableEntity*) player;
+     
+      PlayerInfo* player2=entity->getPlayer();
+     
+        if(bIsTriggered)this->reached_=player2;
     }
 
Index: /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h	(revision 8967)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h	(revision 8968)
@@ -64,6 +64,5 @@
 		{return this->nextcheckpoints_;}
 
-	inline void setNext(int index,RaceCheckPoint* p)
-		{this->next_[index]=p;}
+	
  inline void setLast(bool isLast)
                 { this->bIsLast_ = isLast; }
@@ -74,6 +73,6 @@
 	PlayerInfo* reached_;
             	
-	inline void setV(bool b)
-		{this->isVisible_ = b;}
+	inline float getTimeLimit()
+                { return this->bTimeLimit_;}
         protected:
             virtual void fire(bool bIsTriggered,BaseObject* player);
@@ -82,6 +81,5 @@
 
             virtual void setTimelimit(float timeLimit);
-            inline float getTimeLimit()
-                { return this->bTimeLimit_;}
+            
             inline const WorldEntity* getWorldEntity() const
                 { return this; }
@@ -93,6 +91,5 @@
 	Vector3 nextcheckpoints_; //the indexes of the next check points
 
-	bool isVisible_;
-
+	
 	
       std::vector<RaceCheckPoint*> next_;
Index: /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc	(revision 8967)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc	(revision 8968)
@@ -29,5 +29,4 @@
 #include "SpaceRace.h"
 
-//#include "SpaceRaceManager.h"
 
 #include "items/Engine.h"
@@ -100,6 +99,8 @@
     void SpaceRace::start()
     {
-    		//Gametype::start();
-  	  		   this->spawnPlayersIfRequested(); Gametype::checkStart(); 
+    		
+  	  		   this->spawnPlayersIfRequested();
+  	  		   
+  	  		    Gametype::checkStart(); 
   	  		   this->cantMove_=true; 
     	 
@@ -142,54 +143,39 @@
       
     }
-    // for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
-      //  {if(this->getCheckpointReached(it->first)==-1) orxout()<<"index -1"<<endl;}
+    
    
     }
 
-	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++){
-        	if(v[i]==0){
-        	 RaceCheckPoint* n=m->getCheckpoint(v[i]);
-           	 n->setV(true);
-           	 }}
-	}*/
-	}
-
+	
+    
     void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl)
-    {/*
-        this->checkpointReached_[pl]=index;
+	    {
+	        this->checkpointReached_[pl]=index;
         this->clock_.capture();
-        int s = this->clock_.getSeconds();
+	        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)
+	        const std::string& message = "Checkpoint " + multi_cast<std::string>(index)
                         + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
-                        + " seconds.";
+	                        + " 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);
+     	    {   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)
+	                        + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
                         + " seconds.";
-        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
-        ChatManager::message(message);
-        
-       
-    }
+	        const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+	        ChatManager::message(message);
+	       
+	       
+	    }
+	    
     
     
@@ -212,3 +198,18 @@
        // return valid_player;
 	}
+	
+	 bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator)
+    {
+        return false;
+    }
+
+    bool SpaceRace::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return false;
+    }
+
+    bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return false;
+    }
 }
Index: /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h	(revision 8967)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h	(revision 8968)
@@ -76,5 +76,9 @@
 
 
-	 void setV(SpaceRaceManager* m);
+	  bool allowPawnHit(Pawn* victim, Pawn* originator);
+
+    bool allowPawnDamage(Pawn* victim, Pawn* originator);
+
+    bool allowPawnDeath(Pawn* victim, Pawn* originator);
         protected:
 		virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
Index: /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc	(revision 8967)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc	(revision 8968)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *     Mauro Salomon
+ *     Celine Eggenberger
  *   Co-authors:
  *      ...
@@ -38,4 +38,6 @@
 #include "util/Math.h"
 
+
+
 namespace orxonox
 {
@@ -46,7 +48,6 @@
         RegisterObject(SpaceRaceManager);
          
-         for (size_t i = 0; i < this->checkpoints_.size(); ++i)
-                this->setNext(this->checkpoints_[i]);
-          
+        this->firstcheckpointvisible_=false;
+         
     }
 
@@ -95,7 +96,7 @@
     {
     SUPER(SpaceRaceManager,tick,dt);
-     SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
-     gametype->setV(this);
-         
+     
+     if(this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
+         {this->checkpoints_[0]->setRadarVisibility(true);this->firstcheckpointvisible_=false;}
          
     	 for (size_t i = 0; i < this->checkpoints_.size(); ++i){
@@ -111,14 +112,15 @@
         assert(gametype);
         
-        //if(gametype->getCheckpointReached(player)==-1) {orxout()<<"index -1"<<endl;}
+       
    
         	 bool b =false;	
-        	//DistanceMultiTrigger::fire(bIsTriggered,player);
+        	
         	int index=gametype->getCheckpointReached(player);
+        	Vector3 v=Vector3 (-1,-1,-1);
         	if (index>-1){
         	RaceCheckPoint* tmp= this->getCheckpoint(index);
-        	Vector3 v= tmp->getNextcheckpoint();
+        	v= tmp->getNextcheckpoint();
        
-       // orxout()<<"index not -1"<<endl;
+       
         if (this->getCheckpoint(v.x)==check){
         	b=true;
@@ -137,5 +139,5 @@
             gametype->clock_.capture();
             float time = gametype->clock_.getSecondsPrecise();
-            if (check->bTimeLimit_!=0 && time > check->bTimeLimit_)
+            if (check->getTimeLimit()!=0 && time > check->getTimeLimit())
             {
                 gametype->timeIsUp();
@@ -146,6 +148,12 @@
             else
             {
+            	if (index > -1)this->setRadVis(player,false);
                 gametype->newCheckpointReached(check,player);
                 check->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
+                
+                
+                
+                this->setRadVis(player, true);
+               
             }
         }
@@ -153,13 +161,23 @@
     }
     
+    void SpaceRaceManager::setRadVis(PlayerInfo* player, bool b){
+    	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();
     
     
-    void SpaceRaceManager::setNext(RaceCheckPoint* check){
-    	
-    	Vector3 v=check->getNextcheckpoint();
-    		check->setNext(0,this->getCheckpoint(v.x));
-    	check->setNext(1,this->getCheckpoint(v.y));
-    	check->setNext(2,this->getCheckpoint(v.z));
-    	}
+    	 if(v.x > -1){this->getCheckpoint(v.x)->setRadarVisibility(b);
+                this->getCheckpoint(v.x)->settingsChanged();}
+                if(v.y > -1){this->getCheckpoint(v.y)->setRadarVisibility(b);
+                this->getCheckpoint(v.y)->settingsChanged();}
+                if(v.z > -1){this->getCheckpoint(v.z)->setRadarVisibility(b);
+                this->getCheckpoint(v.z)->settingsChanged();}
+    
+    }
+    
+    
     
     
Index: /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h
===================================================================
--- /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h	(revision 8967)
+++ /code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.h	(revision 8968)
@@ -42,4 +42,6 @@
 #include "RaceCheckPoint.h"
 
+
+
 namespace orxonox
 {
@@ -64,12 +66,12 @@
 	void checkpointReached(RaceCheckPoint* check, PlayerInfo* player);
 		
-	void setNext(RaceCheckPoint* check);
+	
 
 	void tick(float dt);
         protected:
-		
+		 void setRadVis(PlayerInfo* player, bool b);
         private:
 		std::vector<RaceCheckPoint*> checkpoints_;
- 		
+ 		bool firstcheckpointvisible_;
 		
 		
Index: /code/branches/spaceraceTwo/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- /code/branches/spaceraceTwo/src/orxonox/controllers/WaypointPatrolController.cc	(revision 8967)
+++ /code/branches/spaceraceTwo/src/orxonox/controllers/WaypointPatrolController.cc	(revision 8968)
@@ -78,5 +78,5 @@
 
     void WaypointPatrolController::searchEnemy()
-    {
+    {/*
         this->patrolTimer_.setInterval(rnd());
 
@@ -101,5 +101,5 @@
 
         if (shortestsqdistance > (this->alertnessradius_ * this->alertnessradius_))
-            this->target_ = 0;
+            this->target_ = 0;*/
     }
 }
Index: /code/branches/spaceraceTwo/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- /code/branches/spaceraceTwo/src/orxonox/infos/PlayerInfo.cc	(revision 8967)
+++ /code/branches/spaceraceTwo/src/orxonox/infos/PlayerInfo.cc	(revision 8968)
@@ -57,4 +57,5 @@
 
         this->registerVariables();
+        
     }
 
