Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-24 22:55:28 +0000
committerStijn Buys <ingar@osirion.org>2008-08-24 22:55:28 +0000
commit02e623574c4c12c40a0757ed934a93353f34a653 (patch)
tree49fa76c6dd8bab80520601d5d5f0436e7befad5f /src/game/ship.cc
parente422dc200a1036ec6c1a93eea2f0b6abdcdadb7a (diff)
impulse disables thrust
Diffstat (limited to 'src/game/ship.cc')
-rw-r--r--src/game/ship.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/game/ship.cc b/src/game/ship.cc
index 6ca29ba..a5d64f3 100644
--- a/src/game/ship.cc
+++ b/src/game/ship.cc
@@ -210,7 +210,7 @@ void Ship::frame(float seconds)
// FIXME 5 second cooldown
entity_eventstate = core::Entity::Normal;
- } else if (entity_eventstate == core::Entity::ImpulseInitiate) {
+ } else if (entity_eventstate == core::Entity::ImpulseInitiate) {
if (ship_impulsedrive_timer + 1.0f <= core::server()->time()) {
entity_timer -= 1.0f;
@@ -228,7 +228,7 @@ void Ship::frame(float seconds)
}
// clamp input values
- target_thrust = 1.0f;
+ target_thrust = 0.0f;
math::clamp(target_pitch, -1.0f, 1.0f);
math::clamp(target_roll, -1.0f, 1.0f);
math::clamp(target_direction, -1.0f, 1.0f);
@@ -238,7 +238,7 @@ void Ship::frame(float seconds)
} else if (entity_eventstate == core::Entity::Impulse) {
// clamp input values
- target_thrust = 1.0f;
+ target_thrust = 0.0f;
math::clamp(target_pitch, -1.0f, 1.0f);
math::clamp(target_roll, -1.0f, 1.0f);
math::clamp(target_direction, -1.0f, 1.0f);
@@ -356,6 +356,10 @@ void Ship::frame(float seconds)
math::clamp(entity_thrust, 0.0f, 1.0f);
float actual_thrust = entity_thrust + current_target_afterburner * 0.15f;
+ if ((entity_eventstate == core::Entity::ImpulseInitiate) || (entity_eventstate == core::Entity::Impulse)) {
+ actual_thrust = 1.0f;
+ }
+
// update speed
if (entity_speed < actual_thrust * actual_maxspeed) {
entity_speed += actual_acceleration * seconds;