Changeset 5860 for code/branches/core5/src/modules
- Timestamp:
- Oct 2, 2009, 8:41:33 PM (15 years ago)
- Location:
- code/branches/core5/src/modules/weapons/projectiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/modules/weapons/projectiles/Projectile.cc
r5831 r5860 133 133 } 134 134 135 void Projectile:: destroyedPawn(Pawn* pawn)135 void Projectile::setOwner(Pawn* owner) 136 136 { 137 if (this->owner_ == pawn) 138 this->owner_ = 0; 137 this->owner_ = owner; 139 138 } 140 139 } -
code/branches/core5/src/modules/weapons/projectiles/Projectile.h
r5831 r5860 33 33 34 34 #include "tools/Timer.h" 35 #include "interfaces/PawnListener.h"36 35 #include "worldentities/MovableEntity.h" 37 36 38 37 namespace orxonox 39 38 { 40 class _WeaponsExport Projectile : public MovableEntity , public PawnListener39 class _WeaponsExport Projectile : public MovableEntity 41 40 { 42 41 public: … … 49 48 virtual void tick(float dt); 50 49 virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 51 virtual void destroyedPawn(Pawn* pawn);52 50 53 51 inline void setDamage(float damage) … … 56 54 { return this->damage_; } 57 55 58 inline void setOwner(Pawn* owner) 59 { this->owner_ = owner; } 56 void setOwner(Pawn* owner); 60 57 inline Pawn* getOwner() const 61 58 { return this->owner_; } 62 59 63 60 private: 64 Pawn*owner_;61 WeakPtr<Pawn> owner_; 65 62 float lifetime_; 66 63 float damage_;
Note: See TracChangeset
for help on using the changeset viewer.