[Orxonox-commit 4994] r9663 - in code/trunk/src/orxonox: controllers worldentities/pawns

landauf at orxonox.net landauf at orxonox.net
Sun Aug 25 10:03:25 CEST 2013


Author: landauf
Date: 2013-08-25 10:03:25 +0200 (Sun, 25 Aug 2013)
New Revision: 9663

Modified:
   code/trunk/src/orxonox/controllers/FormationController.cc
   code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
Log:
replaced tabs with spaces

Modified: code/trunk/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.cc	2013-08-24 17:04:40 UTC (rev 9662)
+++ code/trunk/src/orxonox/controllers/FormationController.cc	2013-08-25 08:03:25 UTC (rev 9663)
@@ -541,11 +541,11 @@
 
             if (!this->slaves_.empty())
             {
-				std::vector<FormationController*>::iterator it2 = std::find(this->slaves_.begin(), this->slaves_.end(), newMaster);
-				if (it2 != this->slaves_.end())
-				{
-					 this->slaves_.erase(it2);
-				}
+                std::vector<FormationController*>::iterator it2 = std::find(this->slaves_.begin(), this->slaves_.end(), newMaster);
+                if (it2 != this->slaves_.end())
+                {
+                    this->slaves_.erase(it2);
+                }
 
                 newMaster->state_ = MASTER;
                 newMaster->slaves_ = this->slaves_;

Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	2013-08-24 17:04:40 UTC (rev 9662)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	2013-08-25 08:03:25 UTC (rev 9663)
@@ -323,34 +323,34 @@
 
             if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this)
             {
-            	// Start to control a new entity if you're the master of a formation
-            	if(this->hasSlaves())
-            	{
-            		Controller* slave = this->getSlave();
-            		ControllableEntity* entity = slave->getControllableEntity();
+                // Start to control a new entity if you're the master of a formation
+                if(this->hasSlaves())
+                {
+                    Controller* slave = this->getSlave();
+                    ControllableEntity* entity = slave->getControllableEntity();
 
 
-            		if(!entity->hasHumanController())
-            		{
-            			// delete the AIController
-            			slave->setControllableEntity(0);
+                    if(!entity->hasHumanController())
+                    {
+                        // delete the AIController
+                        slave->setControllableEntity(0);
 
-						// set a new master within the formation
-						orxonox_cast<FormationController*>(this->getController())->setNewMasterWithinFormation(orxonox_cast<FormationController*>(slave));
+                        // set a new master within the formation
+                        orxonox_cast<FormationController*>(this->getController())->setNewMasterWithinFormation(orxonox_cast<FormationController*>(slave));
 
-						// start to control a slave
-						this->getPlayer()->startControl(entity);
-            		}
-            		else
-                	{
-                		this->getPlayer()->stopControl();
-                	}
+                        // start to control a slave
+                        this->getPlayer()->startControl(entity);
+                    }
+                    else
+                    {
+                        this->getPlayer()->stopControl();
+                    }
 
-            	}
-            	else
-            	{
-            		this->getPlayer()->stopControl();
-            	}
+                }
+                else
+                {
+                    this->getPlayer()->stopControl();
+                }
             }
             if (GameMode::isMaster())
             {
@@ -502,27 +502,27 @@
     // A function to check if this pawn's controller is the master of any formationcontroller
     bool Pawn::hasSlaves()
     {
-    	for (ObjectList<FormationController>::iterator it =
-			 ObjectList<FormationController>::begin();
-			 it != ObjectList<FormationController>::end(); ++it )
-		{
-			// checks if the pawn's controller has a slave
-			if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
-				return true;
-		}
-		return false;
+        for (ObjectList<FormationController>::iterator it =
+             ObjectList<FormationController>::begin();
+             it != ObjectList<FormationController>::end(); ++it )
+        {
+            // checks if the pawn's controller has a slave
+            if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
+                return true;
+        }
+        return false;
     }
 
     // A function that returns a slave of the pawn's controller
     Controller* Pawn::getSlave(){
-    	for (ObjectList<FormationController>::iterator it =
-    			ObjectList<FormationController>::begin();
-    			it != ObjectList<FormationController>::end(); ++it )
-    	{
-    		if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
-    			return it->getController();
-    	}
-    	return 0;
+        for (ObjectList<FormationController>::iterator it =
+                ObjectList<FormationController>::begin();
+                it != ObjectList<FormationController>::end(); ++it )
+        {
+            if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
+                return it->getController();
+        }
+        return 0;
     }
 
 




More information about the Orxonox-commit mailing list