diff options
-rw-r--r-- | src/game/base/projectile.cc | 1 | ||||
-rw-r--r-- | src/game/base/projectile.h | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/game/base/projectile.cc b/src/game/base/projectile.cc index b80d7a6..6bcbad9 100644 --- a/src/game/base/projectile.cc +++ b/src/game/base/projectile.cc @@ -33,6 +33,7 @@ Projectile::Projectile(unsigned long lifespan) : EntityDynamic() projectile_damage = 0.0f; projectile_lifespan = lifespan; projectile_timestamp = core::server()->timestamp(); + projectile_ownerid = 0; } Projectile::~Projectile() diff --git a/src/game/base/projectile.h b/src/game/base/projectile.h index 238de6a..877632f 100644 --- a/src/game/base/projectile.h +++ b/src/game/base/projectile.h @@ -47,6 +47,14 @@ public: return projectile_damage; } + /** + * @brief id of the player who fired the projectile + * */ + inline const int ownerid() const + { + return projectile_ownerid; + } + /* --- mutators -------------------------------------------- */ /** @@ -55,7 +63,12 @@ public: inline void set_damage(const float damage) { projectile_damage = damage; - } + } + + inline void set_ownerid(const int ownerid) + { + projectile_ownerid = ownerid; + } private: unsigned long projectile_timestamp; @@ -63,6 +76,8 @@ private: unsigned long projectile_lifespan; float projectile_damage; + + int projectile_ownerid; }; } // namespace game |