From 7e14c9fbb8767d6ebfb2e3bb94020767b074b9fa Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 17 Oct 2013 20:04:57 +0000 Subject: Remove the bullet physics body from destroyed ships, do not delete the entity to make sure explosions are shown. --- src/game/base/ship.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/game') 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 -- cgit v1.2.3