- Timestamp:
- Nov 23, 2011, 4:06:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/formation/src/orxonox/controllers/HumanController.cc
r8943 r8948 77 77 this->boosting_ = false; 78 78 this->boosting_ = false; 79 79 this->tempMaster=NULL; 80 80 HumanController::localController_s = this; 81 81 this->boostingTimeout_.setTimer(HumanController::BOOSTING_TIME, false, createExecutor(createFunctor(&HumanController::terminateBoosting, this))); 82 82 this->boostingTimeout_.stopTimer(); 83 this->state_= MASTER;83 this->state_=FREE; 84 84 } 85 85 86 86 HumanController::~HumanController() 87 87 { 88 if (HumanController::localController_s) 89 { 90 HumanController::localController_s->removeFromFormation(); 91 } 88 92 HumanController::localController_s = 0; 89 if (this->state_==MASTER)90 removeFromFormation();91 93 } 92 94 … … 101 103 102 104 // commandslaves when Master of a formation 103 if ( this->state_==MASTER)104 { 105 this->commandSlaves();105 if (HumanController::localController_s && HumanController::localController_s->state_==MASTER) 106 { 107 HumanController::localController_s->commandSlaves(); 106 108 } 107 109 } … … 274 276 void HumanController::toggleFormationFlight() 275 277 { 278 276 279 if (HumanController::localController_s) 277 280 { … … 280 283 HumanController::localController_s->freeSlaves(); 281 284 HumanController::localController_s->state_=FREE; 285 orxout(message) <<"FormationFlight disabled "<< endl; 282 286 } else //SLAVE or FREE 283 287 { 284 288 HumanController::localController_s->takeLeadOfFormation(); 289 orxout(message) <<"FormationFlight enabled "<< endl; 285 290 } 291 286 292 } 287 293
Note: See TracChangeset
for help on using the changeset viewer.