Changeset 11071 for code/trunk/src/modules/invader/InvaderShip.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/modules/invader/InvaderShip.cc
r10624 r11071 37 37 #include "core/XMLPort.h" 38 38 #include "Invader.h" 39 #include "InvaderEnemy.h" 40 #include "graphics/Camera.h" 41 #include "weapons/projectiles/Projectile.h" 39 42 40 43 namespace orxonox … … 92 95 // Camera 93 96 Camera* camera = this->getCamera(); 94 if (camera != NULL)97 if (camera != nullptr) 95 98 { 96 99 camera->setPosition(Vector3(-pos.z, -posforeward, 0)); … … 139 142 isFireing = bBoost; 140 143 } 141 inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 144 void InvaderShip::rotateRoll(const Vector2& value) 145 { 146 if (getGame()) 147 if (getGame()->bEndGame) 148 getGame()->end(); 149 } 150 inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 142 151 { 143 152 // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint; … … 145 154 Projectile* shot = orxonox_cast<Projectile*>(otherObject); 146 155 // ensure that this gets only called once per enemy. 147 if (enemy != NULL&& lastEnemy != enemy)156 if (enemy != nullptr && lastEnemy != enemy) 148 157 { 149 158 lastEnemy = enemy; … … 156 165 } 157 166 // was shot, decrease multiplier 158 else if (shot != NULL&& lastShot != shot)167 else if (shot != nullptr && lastShot != shot) 159 168 { 160 if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)169 if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != nullptr) 161 170 { 162 171 if (getGame()->multiplier > 1) … … 173 182 Invader* InvaderShip::getGame() 174 183 { 175 if (game == NULL)184 if (game == nullptr) 176 185 { 177 for ( ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)178 game = *it;186 for (Invader* invader : ObjectList<Invader>()) 187 game = invader; 179 188 } 180 189 return game;
Note: See TracChangeset
for help on using the changeset viewer.