From 4a20c54293e7065ec1f4f6e8c48cdf8c05582a01 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 14 Nov 2012 17:54:51 +0000 Subject: Only allow gunfire if Ship::state() == Entity::Normal, do not activate impulse engines during ImpulseInitiate --- src/game/base/ship.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index 8be6e6c..854bdab 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -364,20 +364,20 @@ void Ship::action (btScalar seconds) switch (entity_state) { case core::Entity::Normal: engine_force = ship_thrust_force * entity_thrust; - //maxspeed = ship_shipmodel->maxspeed() * entity_thrust; break; case core::Entity::ImpulseInitiate: + engine_force = ship_thrust_force * entity_thrust; + break; + case core::Entity::Impulse: engine_force = ship_impulse_force; - //maxspeed = (Game::g_impulsespeed ? Game::g_impulsespeed->value() * 0.01f : 0.0f); turn_force *= .5f; roll_force *= .5f; break; case core::Entity::JumpInitiate: case core::Entity::Jump: - //maxspeed = 0.0f; engine_force = 0.0f; break; @@ -386,7 +386,6 @@ void Ship::action (btScalar seconds) break; default: - //maxspeed = 0.0f; engine_force = 0.0f; break; } @@ -765,7 +764,7 @@ void Ship::frame(const unsigned long elapsed) EntityControlable::frame(elapsed); - if (model() && slots() && has_controlflag(core::EntityControlable::ControlFlagFire)) { + if (model() && slots() && (state() == core::Entity::Normal) && has_controlflag(core::EntityControlable::ControlFlagFire)) { const float modelscale = radius() / model()->radius(); -- cgit v1.2.3