You shouldn't get frags by killing yourself anymore.
--- a/src/Player.cc Mon Dec 08 20:57:16 2008 +0000
+++ b/src/Player.cc Mon Dec 08 21:00:50 2008 +0000
@@ -295,7 +295,9 @@
health -= source->getDamage();
if (health <= 0) {
- source->addKillToOwner();
+ if (this != source->getOwner()) {
+ source->addKillToOwner();
+ }
die();
}
--- a/src/Projectile.cc Mon Dec 08 20:57:16 2008 +0000
+++ b/src/Projectile.cc Mon Dec 08 21:00:50 2008 +0000
@@ -44,6 +44,10 @@
void Projectile::addKillToOwner () {
player->addKill();
}
+
+const Player* Projectile::getOwner () {
+ return player;
+}
void Projectile::onHitPlayer (Player *player) {
player->takeDamage(this);
--- a/src/Projectile.hh Mon Dec 08 20:57:16 2008 +0000
+++ b/src/Projectile.hh Mon Dec 08 21:00:50 2008 +0000
@@ -63,6 +63,11 @@
*/
void addKillToOwner ();
+ /**
+ * Return the owner of the projectile.
+ */
+ const Player* getOwner ();
+
protected:
/**
* Removes ground at given position if applicable, and destroys this PhysicsObject.