- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 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/modules/invader/InvaderEnemy.cc
r10625 r11054 32 32 */ 33 33 34 #include "invader/InvaderPrereqs.h"35 34 #include "InvaderEnemy.h" 35 36 #include "core/CoreIncludes.h" 37 #include "Invader.h" 36 38 #include "InvaderShip.h" 37 39 … … 54 56 removeHealth(2000); 55 57 56 if (player != NULL)58 if (player != nullptr) 57 59 { 58 60 float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z); … … 62 64 } 63 65 64 inline bool InvaderEnemy::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)66 inline bool InvaderEnemy::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 65 67 { 66 68 if(orxonox_cast<InvaderShip*>(otherObject)) … … 71 73 Invader* InvaderEnemy::getGame() 72 74 { 73 if (game == NULL)75 if (game == nullptr) 74 76 { 75 for ( ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)76 game = *it;77 for (Invader* invader : ObjectList<Invader>()) 78 game = invader; 77 79 } 78 80 return game; … … 82 84 { 83 85 Pawn::damage(damage, healthdamage, shielddamage, originator, cs); 84 if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL&& getHealth() <= 0)86 if (getGame() && orxonox_cast<InvaderShip*>(originator) != nullptr && getHealth() <= 0) 85 87 getGame()->addPoints(42); 86 88 }
Note: See TracChangeset
for help on using the changeset viewer.