Changeset 9616 for code/branches/formationupdate
- Timestamp:
- Apr 23, 2013, 3:47:49 PM (12 years ago)
- Location:
- code/branches/formationupdate/src/orxonox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/formationupdate/src/orxonox/controllers/FormationController.h
r9613 r9616 59 59 static void passivebehaviour(const bool passive); 60 60 static void formationsize(const int size); 61 void takeLeadOfFormation(); 61 62 62 63 inline void setFormationFlight(bool formation) … … 139 140 bool forcedFree(); 140 141 141 void takeLeadOfFormation();142 142 void masterAttacked(Pawn* originator); 143 143 -
code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
r9615 r9616 318 318 it != ObjectList<FormationController>::end(); ++it ) 319 319 { 320 // checks if the dyingPawn has a slave320 // checks if the Pawn has a slave 321 321 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController()) 322 {323 orxout(user_warning) << "This is a Slave of the HumanController: " << it->getThis() << endl;324 322 return true; 325 }326 323 } 327 orxout(user_warning) << "The HumanController has no slaves!" << endl;328 324 return false; 329 325 } … … 357 353 if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this) 358 354 { 359 /* Do different things if Pawn is the Master of a Formation 360 * Doesn't work yet 361 * 362 */ if(this->hasSlaves()) 355 356 // Do different things if Pawn is the Master of a Formation 357 if(this->hasSlaves()) 363 358 { 364 // start to control a slave 365 this->getPlayer()->startControl(this->getSlave()->getControllableEntity()); 359 Controller* slave = this->getSlave(); 360 ControllableEntity* entity = slave->getControllableEntity(); 361 362 // set new Master 363 orxonox_cast<FormationController*>(slave)->takeLeadOfFormation(); 364 365 366 /* TO DO: - new Master is not set right 367 * - The slave still has a AIController 368 * 369 */ 370 //slave->getPlayer()->stopControl(); 371 372 // start to control a slave 373 this->getPlayer()->startControl(entity); 366 374 } 367 else{ 368 this->getPlayer()->stopControl(); 369 } 375 else 376 { 377 this->getPlayer()->stopControl(); 378 } 370 379 } 371 380 if (GameMode::isMaster())
Note: See TracChangeset
for help on using the changeset viewer.