Index: code/branches/ai/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 6600)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 6601)
@@ -30,4 +30,5 @@
 
 #include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
 #include "worldentities/ControllableEntity.h"
 #include "worldentities/pawns/Pawn.h"
@@ -43,4 +44,6 @@
 
         this->target_ = 0;
+	this->team_ = 0;//new
+	this->isMaster_ = false;//new
         this->bShooting_ = false;
         this->bHasTargetPosition_ = false;
@@ -52,4 +55,11 @@
     ArtificialController::~ArtificialController()
     {
+    }
+
+    void ArtificialController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(ArtificialController, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ArtificialController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
     }
 
@@ -188,15 +198,25 @@
         int team2 = -1;
 
-        if (entity1->getXMLController())
-        {
-            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController*>(entity1->getXMLController());
-            if (wpc)
-                team1 = wpc->getTeam();
-        }
-        if (entity2->getXMLController())
-        {
-            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController*>(entity2->getXMLController());
-            if (wpc)
-                team2 = wpc->getTeam();
+        Controller* controller = 0;
+        if (entity1->getController())
+            controller = entity1->getController();
+        else
+            controller = entity1->getXMLController();
+        if (controller)
+        {
+            ArtificialController* ac = orxonox_cast<ArtificialController*>(controller);
+            if (ac)
+                team1 = ac->getTeam();
+        }
+
+        if (entity1->getController())
+            controller = entity1->getController();
+        else
+            controller = entity1->getXMLController();
+        if (controller)
+        {
+            ArtificialController* ac = orxonox_cast<ArtificialController*>(controller);
+            if (ac)
+                team2 = ac->getTeam();
         }
 
Index: code/branches/ai/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.h	(revision 6600)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.h	(revision 6601)
@@ -43,5 +43,13 @@
             virtual ~ArtificialController();
 
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);//new
+
             void abandonTarget(Pawn* target);
+
+            inline void setTeam(int team)//new
+                { this->team_ = team; }
+            inline int getTeam() const
+                { return this->team_; }
+
 
         protected:
@@ -69,4 +77,7 @@
             bool bShooting_;
 
+            bool isMaster_;//new
+            int team_;//new
+
         private:
     };
Index: code/branches/ai/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/WaypointPatrolController.cc	(revision 6600)
+++ code/branches/ai/src/orxonox/controllers/WaypointPatrolController.cc	(revision 6601)
@@ -42,5 +42,5 @@
         RegisterObject(WaypointPatrolController);
 
-        this->team_ = 0;
+        //this->team_ = 0;
         this->alertnessradius_ = 500;
 
@@ -53,5 +53,5 @@
 
         XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
-        XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
+//        XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
     }
 
Index: code/branches/ai/src/orxonox/controllers/WaypointPatrolController.h
===================================================================
--- code/branches/ai/src/orxonox/controllers/WaypointPatrolController.h	(revision 6600)
+++ code/branches/ai/src/orxonox/controllers/WaypointPatrolController.h	(revision 6601)
@@ -46,8 +46,8 @@
             virtual void tick(float dt);
 
-            inline void setTeam(int team)
+           /* inline void setTeam(int team)
                 { this->team_ = team; }
             inline int getTeam() const
-                { return this->team_; }
+                { return this->team_; } */
 
             inline void setAlertnessRadius(float radius)
@@ -59,5 +59,5 @@
             void searchEnemy();
 
-            int team_;
+            //int team_;
             float alertnessradius_;
             Timer patrolTimer_;
