Changeset 5860 for code/branches
- Timestamp:
- Oct 2, 2009, 8:41:33 PM (15 years ago)
- Location:
- code/branches/core5/src
- Files:
-
- 3 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_; -
code/branches/core5/src/orxonox/gametypes/TeamDeathmatch.cc
r5859 r5860 100 100 bool TeamDeathmatch::allowPawnHit(Pawn* victim, Pawn* originator) 101 101 { 102 return (!this->pawnsAreInTheSameTeam(victim, originator) );102 return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator); 103 103 } 104 104 105 105 bool TeamDeathmatch::allowPawnDamage(Pawn* victim, Pawn* originator) 106 106 { 107 return (!this->pawnsAreInTheSameTeam(victim, originator) );107 return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator); 108 108 } 109 109 110 110 bool TeamDeathmatch::allowPawnDeath(Pawn* victim, Pawn* originator) 111 111 { 112 return (!this->pawnsAreInTheSameTeam(victim, originator) );112 return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator); 113 113 } 114 114
Note: See TracChangeset
for help on using the changeset viewer.