Changeset 11071 for code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r11052 r11071 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 … … 86 86 this->aimPosition_ = Vector3::ZERO; 87 87 88 //this->explosionPartList_ = NULL;88 //this->explosionPartList_ = nullptr; 89 89 90 90 if (GameMode::isMaster()) … … 94 94 } 95 95 else 96 this->weaponSystem_ = 0;96 this->weaponSystem_ = nullptr; 97 97 98 98 this->setRadarObjectColour(ColourValue::Red); 99 this->setRadarObjectShape(RadarViewable:: Dot);99 this->setRadarObjectShape(RadarViewable::Shape::Dot); 100 100 101 101 this->registerVariables(); … … 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; 513 } 514 515 std::vector<WeaponPack *> * Pawn::getAllWeaponPacks() 516 { 517 if (this->weaponSystem_) 518 return this->weaponSystem_->getAllWeaponPacks(); 519 else 520 return 0; 512 return nullptr; 521 513 } 522 514 … … 531 523 Munition* Pawn::getMunitionXML() const 532 524 { 533 return NULL;525 return nullptr; 534 526 } 535 527 … … 541 533 } 542 534 543 return NULL;535 return nullptr; 544 536 } 545 537 … … 564 556 bool Pawn::hasSlaves() 565 557 { 566 for (ObjectList<FormationController>::iterator it = 567 ObjectList<FormationController>::begin(); 568 it != ObjectList<FormationController>::end(); ++it ) 558 for (FormationController* controller : ObjectList<FormationController>()) 569 559 { 570 560 // checks if the pawn's controller has a slave 571 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())561 if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController()) 572 562 return true; 573 563 } … … 577 567 // A function that returns a slave of the pawn's controller 578 568 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; 569 for (FormationController* controller : ObjectList<FormationController>()) 570 { 571 if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController()) 572 return controller->getController(); 573 } 574 return nullptr; 587 575 } 588 576
Note: See TracChangeset
for help on using the changeset viewer.