diff options
author | Stijn Buys <ingar@osirion.org> | 2013-11-10 17:13:41 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-11-10 17:13:41 +0000 |
commit | 5f0958c121a246d445507313984358ff8a6df3fa (patch) | |
tree | 34f0b53f0e7de9bee09ad8bcafa4228654365ae5 /src/game/base/ship.cc | |
parent | 82f0ac05f5da2d89c4a544ca22ff47e116e6dd97 (diff) |
Adjust reputation on NPC kills,
refresh reputation window if required.
Diffstat (limited to 'src/game/base/ship.cc')
-rw-r--r-- | src/game/base/ship.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index 2a5d68f..338bc04 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -22,6 +22,7 @@ #include "base/racetrack.h" #include "base/cargo.h" #include "base/cargopod.h" +#include "base/faction.h" using math::degrees360f; using math::degrees180f; @@ -663,13 +664,16 @@ void Ship::hit(core::Entity *other) message.append(" ^Bwent boom."); } core::server()->broadcast(message); - } else { if (assassin) { // assissin killed an NPC assassin->set_npckills(assassin->npckills() + 1); assassin->set_dirty(); + + // faction ship got killed + assert (faction()->type() == Faction::infotype()); + static_cast<const Faction *>(faction())->apply_kill(assassin); } } } @@ -711,6 +715,15 @@ void Ship::hit(core::Entity *other) message.append(" ^Bwas blown to bits."); } core::server()->broadcast(message); + + } else if (faction()) { + + if (assassin) { + // faction ship got killed + assert (faction()->type() == Faction::infotype()); + static_cast<const Faction *>(faction())->apply_kill(assassin); + } + } if (assassin) { |