diff options
| author | Stijn Buys <ingar@osirion.org> | 2012-11-14 17:54:51 +0000 | 
|---|---|---|
| committer | Stijn Buys <ingar@osirion.org> | 2012-11-14 17:54:51 +0000 | 
| commit | 4a20c54293e7065ec1f4f6e8c48cdf8c05582a01 (patch) | |
| tree | 8ae219e94921227df78b38561feb4f99489f3c2d | |
| parent | 31c6d4c5bb5ff17fa926d7d65f8b9a93918fbd3f (diff) | |
Only allow gunfire if Ship::state() == Entity::Normal,
do not activate impulse engines during ImpulseInitiate
| -rw-r--r-- | src/game/base/ship.cc | 9 | 
1 files 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(); | 
