- Timestamp:
- Jan 10, 2016, 1:54:11 PM (10 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.cc
r11052 r11054 77 77 this->shieldRechargeWaitCountdown_ = 0; 78 78 79 this->lastHitOriginator_ = 0;79 this->lastHitOriginator_ = nullptr; 80 80 81 81 // set damage multiplier to default value 1, meaning nominal damage … … 94 94 } 95 95 else 96 this->weaponSystem_ = 0;96 this->weaponSystem_ = nullptr; 97 97 98 98 this->setRadarObjectColour(ColourValue::Red); … … 112 112 else 113 113 { 114 this->explosionSound_ = 0;114 this->explosionSound_ = nullptr; 115 115 } 116 116 } … … 373 373 { 374 374 // delete the AIController // <-- TODO: delete? nothing is deleted here... should we delete the controller? 375 slave->setControllableEntity( 0);375 slave->setControllableEntity(nullptr); 376 376 377 377 // set a new master within the formation … … 468 468 return this->weaponSystem_->getWeaponSlot(index); 469 469 else 470 return 0;470 return nullptr; 471 471 } 472 472 … … 482 482 return this->weaponSystem_->getWeaponSet(index); 483 483 else 484 return 0;484 return nullptr; 485 485 } 486 486 … … 510 510 return this->weaponSystem_->getWeaponPack(index); 511 511 else 512 return 0;512 return nullptr; 513 513 } 514 514 … … 564 564 bool Pawn::hasSlaves() 565 565 { 566 for (ObjectList<FormationController>::iterator it = 567 ObjectList<FormationController>::begin(); 568 it != ObjectList<FormationController>::end(); ++it ) 566 for (FormationController* controller : ObjectList<FormationController>()) 569 567 { 570 568 // checks if the pawn's controller has a slave 571 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())569 if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController()) 572 570 return true; 573 571 } … … 577 575 // A function that returns a slave of the pawn's controller 578 576 Controller* Pawn::getSlave(){ 579 for (ObjectList<FormationController>::iterator it = 580 ObjectList<FormationController>::begin(); 581 it != ObjectList<FormationController>::end(); ++it ) 582 { 583 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController()) 584 return it->getController(); 585 } 586 return 0; 577 for (FormationController* controller : ObjectList<FormationController>()) 578 { 579 if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController()) 580 return controller->getController(); 581 } 582 return nullptr; 587 583 } 588 584
Note: See TracChangeset
for help on using the changeset viewer.