[Orxonox-commit 5134] r9799 - code/trunk/src/orxonox/worldentities
jo at orxonox.net
jo at orxonox.net
Thu Nov 21 18:37:34 CET 2013
Author: jo
Date: 2013-11-21 18:37:34 +0100 (Thu, 21 Nov 2013)
New Revision: 9799
Modified:
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
Log:
Make controllable entities adapt the controllers team number.
Modified: code/trunk/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.cc 2013-11-21 15:43:52 UTC (rev 9798)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.cc 2013-11-21 17:37:34 UTC (rev 9799)
@@ -349,6 +349,8 @@
this->playerID_ = player->getObjectID();
this->bHasLocalController_ = player->isLocalPlayer();
this->bHasHumanController_ = player->isHumanPlayer();
+ if(controller_ != NULL)
+ this->team_ = controller_->getTeam(); // forward controller team number
if (this->bHasLocalController_ && this->bHasHumanController_)
{
@@ -461,6 +463,7 @@
this->xmlcontroller_ = controller;
this->bHasLocalController_ = true;
this->xmlcontroller_->setControllableEntity(this);
+ this->team_ = this->xmlcontroller_->getTeam(); //forward the team number
}
else
orxout(internal_warning) << "ControllableEntity \"" << this->getName() << "\" already has a Controller." << endl;
More information about the Orxonox-commit
mailing list