Changeset 10765 for code/branches/cpp11_v2/src/modules/invader
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules/invader
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/invader/Invader.cc
r10733 r10765 78 78 { 79 79 level++; 80 if (getPlayer() != NULL)80 if (getPlayer() != nullptr) 81 81 { 82 82 for (int i = 0; i < 7; i++) … … 96 96 InvaderShip* Invader::getPlayer() 97 97 { 98 if (player == NULL)98 if (player == nullptr) 99 99 { 100 100 for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it) … … 106 106 void Invader::spawnEnemy() 107 107 { 108 if (getPlayer() == NULL)108 if (getPlayer() == nullptr) 109 109 return; 110 110 … … 158 158 this->bForceSpawn_ = true; 159 159 160 if (this->center_ == NULL) // abandon mission!160 if (this->center_ == nullptr) // abandon mission! 161 161 { 162 162 orxout(internal_error) << "Invader: No Centerpoint specified." << endl; -
code/branches/cpp11_v2/src/modules/invader/InvaderCenterPoint.cc
r10624 r10765 56 56 void InvaderCenterPoint::checkGametype() 57 57 { 58 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(Invader)))58 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Invader))) 59 59 { 60 60 Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype()); -
code/branches/cpp11_v2/src/modules/invader/InvaderEnemy.cc
r10733 r10765 56 56 removeHealth(2000); 57 57 58 if (player != NULL)58 if (player != nullptr) 59 59 { 60 60 float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z); … … 73 73 Invader* InvaderEnemy::getGame() 74 74 { 75 if (game == NULL)75 if (game == nullptr) 76 76 { 77 77 for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it) … … 84 84 { 85 85 Pawn::damage(damage, healthdamage, shielddamage, originator, cs); 86 if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL&& getHealth() <= 0)86 if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0) 87 87 getGame()->addPoints(42); 88 88 } -
code/branches/cpp11_v2/src/modules/invader/InvaderEnemyShooter.cc
r10733 r10765 59 59 removeHealth(2000); 60 60 61 if (player != NULL)61 if (player != nullptr) 62 62 { 63 63 float distPlayer = player->getPosition().z - getPosition().z; … … 77 77 { 78 78 Pawn::damage(damage, healthdamage, shielddamage, originator, cs); 79 if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL&& getHealth() <= 0)79 if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0) 80 80 getGame()->addPoints(3*42); 81 81 } -
code/branches/cpp11_v2/src/modules/invader/InvaderShip.cc
r10733 r10765 95 95 // Camera 96 96 Camera* camera = this->getCamera(); 97 if (camera != NULL)97 if (camera != nullptr) 98 98 { 99 99 camera->setPosition(Vector3(-pos.z, -posforeward, 0)); … … 154 154 Projectile* shot = orxonox_cast<Projectile*>(otherObject); 155 155 // ensure that this gets only called once per enemy. 156 if (enemy != NULL&& lastEnemy != enemy)156 if (enemy != nullptr && lastEnemy != enemy) 157 157 { 158 158 lastEnemy = enemy; … … 165 165 } 166 166 // was shot, decrease multiplier 167 else if (shot != NULL&& lastShot != shot)167 else if (shot != nullptr && lastShot != shot) 168 168 { 169 if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)169 if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != nullptr) 170 170 { 171 171 if (getGame()->multiplier > 1) … … 182 182 Invader* InvaderShip::getGame() 183 183 { 184 if (game == NULL)184 if (game == nullptr) 185 185 { 186 186 for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
Note: See TracChangeset
for help on using the changeset viewer.