Index: code/branches/ai/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/AIController.cc	(revision 6682)
+++ code/branches/ai/src/orxonox/controllers/AIController.cc	(revision 6683)
@@ -49,4 +49,5 @@
     AIController::~AIController()
     {
+        if (this->state_ == MASTER) freeAllSlaves();
     }
 
@@ -56,5 +57,5 @@
         float maxrand = 100.0f / ACTION_INTERVAL;
 
-        if (this->state_==0)
+        if (this->state_ == FREE)//FREE
         {
 
@@ -64,15 +65,17 @@
                 this->searchNewMaster();
 
-            //this->state_=1;
+
 
         }
 
-        if (this->state_==-1)
+        if (this->state_ == SLAVE)//SLAVE
         {
-            
+               // this->bShooting_ = true;
         }
 
-        if (this->state_==1)
+        if (this->state_ == MASTER)//MASTER
         {
+            // command slaves
+            this->commandSlaves();
             // search enemy
             random = rnd(maxrand);
@@ -106,8 +109,8 @@
 
             // shoot
-            random = rnd(maxrand);
+            /*random = rnd(maxrand);
             if (random < 75 && (this->target_ && !this->bShooting_))
                 this->bShooting_ = true;
-
+*/
             // stop shooting
             random = rnd(maxrand);
@@ -122,20 +125,23 @@
             return;
 
-        if (this->state_==1)
+        if (this->state_ == MASTER)
         {
             if (this->target_)
                 this->aimAtTarget();
 
-            if (this->bHasTargetPosition_)
+            /*if (this->bHasTargetPosition_)
                 this->moveToTargetPosition();
-
+*/
             if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
                 this->getControllableEntity()->fire(0);
         }
 
-        if (this->state_==-1)
+        if (this->state_==SLAVE)
         {
-            //this->state_=1;
 
+            if (this->bHasTargetPosition_)
+                this->moveToTargetPosition();
+
+        //this->getControllableEntity()->fire(0);
 
         }
Index: code/branches/ai/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 6682)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 6683)
@@ -45,5 +45,5 @@
         this->target_ = 0;
 	this->team_ = -1;//new
-	this->state_ = 0;//new
+	this->state_ = FREE;//new
         this->bShooting_ = false;
         this->bHasTargetPosition_ = false;
@@ -113,5 +113,5 @@
 
             ArtificialController *controller = static_cast<ArtificialController*>(it->getController());
-            if (controller && controller->getState()!=1)
+            if (controller && controller->getState() != MASTER)
                 continue;
 
@@ -121,5 +121,5 @@
                 //this->target_ = (*it);
                 //this->targetPosition_ = it->getPosition();
-                this->state_ = -1;
+                this->state_ = SLAVE;
 
             }
@@ -127,6 +127,33 @@
 
         //hasn't encountered any masters in range? -> become a master
-        if (state_!=-1) state_=1; // keep in mind: what happens when two masters encounter eache other? -> has to be evaluated in the for loop of within master mode in AIcontroller...
-    }
+        if (state_!=SLAVE) state_=MASTER; // keep in mind: what happens when two masters encounter eache other? -> has to be evaluated in the for loop of within master mode in AIcontroller...
+    }
+
+    void ArtificialController::commandSlaves() {
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            ArtificialController *controller = static_cast<ArtificialController*>(it->getController());
+            if (controller && controller->getState() != MASTER)
+                continue;
+
+            controller->targetPosition_ = this->getControllableEntity()->getPosition();
+        }
+
+    }
+
+    void ArtificialController::freeAllSlaves()
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            ArtificialController *controller = static_cast<ArtificialController*>(it->getController());
+            if (controller && controller->getState() != MASTER)
+                continue;
+
+            controller->state_ = FREE;
+        }
+
+    }
+
 
     void ArtificialController::setTargetPosition(const Vector3& target)
Index: code/branches/ai/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.h	(revision 6682)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.h	(revision 6683)
@@ -59,6 +59,9 @@
             void moveToTargetPosition();
 
+            enum State {SLAVE, MASTER, FREE};
             int getState();
             void searchNewMaster();
+            void commandSlaves();
+            void freeAllSlaves();
 
             void setTargetPosition(const Vector3& target);
@@ -80,5 +83,6 @@
             bool bShooting_;
 
-            int state_;//new master: 1 slave: -1  free: 0 
+
+            State state_;//new master: 1 slave: -1  free: 0 
             int team_;//new
 
