diff options
author | Stijn Buys <ingar@osirion.org> | 2013-10-17 20:04:57 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-10-17 20:04:57 +0000 |
commit | 7e14c9fbb8767d6ebfb2e3bb94020767b074b9fa (patch) | |
tree | cb0ef6594de8c4f425c966777e5c895cb6d5dfce /src/game | |
parent | 28bafa75762012a088a52f71e5b18838a4e678c2 (diff) |
Remove the bullet physics body from destroyed ships,
do not delete the entity to make sure explosions are shown.
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/base/ship.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index c93002c..bc2b318 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -304,8 +304,6 @@ JumpPoint * Ship::find_closest_jumppoint() void Ship::explode() { - set_state(core::Entity::Destroyed); - target_direction = 0; target_pitch = 0; target_roll = 0; @@ -316,6 +314,8 @@ void Ship::explode() target_thrust = 0; entity_thrust = 0; + + set_state(core::Entity::Destroyed); if (owner()) { if (owner()->control() == this) { @@ -569,8 +569,6 @@ void Ship::hit(core::Entity *other) message.append(" ^Bwas blown to bits."); } core::server()->broadcast(message); - } else { - die(); } // send kill sound to assassin @@ -672,6 +670,10 @@ void Ship::frame(const unsigned long elapsed) entity_thrust = 0; entity_speed = 0.0f; + if (body()) { + reset(); + } + } else if (entity_state == core::Entity::JumpInitiate) { if (ship_jumpdrive_timer + 1.0f <= core::server()->time()) { @@ -828,6 +830,10 @@ void Ship::frame(const unsigned long elapsed) target_controlflags = 0; entity_thrust = 0; + + if (body()) { + reset(); + } } // current health |