Index: code/branches/ai/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/AIController.cc	(revision 7843)
+++ code/branches/ai/src/orxonox/controllers/AIController.cc	(revision 8238)
@@ -66,6 +66,6 @@
                 if (this->freedomCount_ == 1)
                 {
-                this->state_ = SLAVE;
-                this->freedomCount_ = 0;
+                    this->state_ = SLAVE;
+                    this->freedomCount_ = 0;
                 }
 
@@ -82,10 +82,10 @@
             // forget enemy
             random = rnd(maxrand);
-            if (random < ((1-botlevel_)*5) && (this->target_))
+            if (random < ((1-botlevel_)*6) && (this->target_))
                 this->forgetTarget();
 
             // next enemy
             random = rnd(maxrand);
-            if (random < ((1-botlevel_)*10) && (this->target_))
+            if (random < (botlevel_*20) && (this->target_))
                 this->searchNewTarget();
 
@@ -220,6 +220,6 @@
                     {
                         this->aimAtTarget();
-		        random = rnd(maxrand);
-		        if(this->botlevel_*100 > random)
+                        random = rnd(maxrand);
+                        if(this->botlevel_*100 > random)
                             this->follow();//If a bot is shooting a player, it shouldn't let him go away easily.
                     }
@@ -254,10 +254,10 @@
                     this->forgetTarget();
                 else
-		{
-		    this->aimAtTarget();
-		    random = rnd(maxrand);
-		    if(this->botlevel_*100 > random)
+                {
+                    this->aimAtTarget();
+                    random = rnd(maxrand);
+                    if(this->botlevel_*100 > random)
                         this->follow();//If a bot is shooting a player, it shouldn't let him go away easily.
-		}
+                 }
             }
 
Index: code/branches/ai/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 7843)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 8238)
@@ -1026,4 +1026,5 @@
     void ArtificialController::doFire()
     {
+        if(ArtificialController::friendlyFire()) return;//catch if the bot would do friendlyFire
         if(!bSetupWorked)//setup: find out which weapons are active ! hard coded: laser is "0", lens flare is "1", ...
         {
@@ -1065,4 +1066,5 @@
         }
     }
+
     
     void ArtificialController::setBotLevel(float level)
Index: code/branches/ai/src/orxonox/controllers/DroneController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/DroneController.cc	(revision 7843)
+++ code/branches/ai/src/orxonox/controllers/DroneController.cc	(revision 8238)
@@ -103,5 +103,6 @@
                     this->isShooting_ = true;
                     this->aimAtTarget();
-                    this->getDrone()->fire(0);
+		    if(!this->friendlyFire())
+                        this->getDrone()->fire(0);
                 }
             }
@@ -147,3 +148,22 @@
             this->destroy();
     }
+    
+    bool DroneController::friendlyFire()
+    {   ControllableEntity* droneEntity_ = this->getControllableEntity();
+        if (!droneEntity_) return false;
+        if(!owner_) return false;
+        if(this->bHasTargetPosition_)
+        {
+            Vector3 ownerPosition_ = owner_->getPosition();
+            Vector3 toOwner_ = owner_->getPosition() - droneEntity_->getPosition();
+            Vector3 toTarget_ = targetPosition_ - droneEntity_->getPosition();
+            if(toTarget_.length() < toOwner_.length()) return false; //owner is far away = in safty
+            float angleToOwner = getAngle(droneEntity_->getPosition(), droneEntity_->getOrientation() * WorldEntity::FRONT, ownerPosition_);
+            float angleToTarget = getAngle(droneEntity_->getPosition(), droneEntity_->getOrientation() * WorldEntity::FRONT, targetPosition_);
+            float angle = angleToOwner - angleToTarget;//angle between target and owner, observed by the drone
+            if(std::sin(angle)*toOwner_.length() < 5.0f)//calculate owner's distance to shooting line
+            return true;
+        }
+        return false;//Default return value: Usually there is no friendlyFire
+    }
 }
Index: code/branches/ai/src/orxonox/controllers/DroneController.h
===================================================================
--- code/branches/ai/src/orxonox/controllers/DroneController.h	(revision 7843)
+++ code/branches/ai/src/orxonox/controllers/DroneController.h	(revision 8238)
@@ -66,4 +66,5 @@
             virtual void action();
             void ownerDied();
+	    bool friendlyFire(); //< returns true if the owner_ would be hit.
             bool isShooting_;
 
