Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-11-18 17:08:42 +0000
committerStijn Buys <ingar@osirion.org>2012-11-18 17:08:42 +0000
commita8078dc796e94f4042905732b9e24253dae9347a (patch)
tree9268ab04c1917aaabf7843073a88a13cd5d1b06e /src/game
parent8fb998ec465031971159e8ecd3475d55326958a3 (diff)
Added support for projectile ownerid.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/projectile.cc1
-rw-r--r--src/game/base/projectile.h17
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