Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/ship.cc')
-rw-r--r--src/game/ship.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/ship.cc b/src/game/ship.cc
index a5d64f3..167c82a 100644
--- a/src/game/ship.cc
+++ b/src/game/ship.cc
@@ -155,6 +155,8 @@ void Ship::frame(float seconds)
float actual_turnspeed = ship_shipmodel->turnspeed();
float actual_acceleration = ship_shipmodel->acceleration();
+ entity_movement = 0;
+
// speed might get set to 0 on this update
if (entity_speed != 0.0f)
entity_dirty = true;
@@ -388,10 +390,17 @@ void Ship::frame(float seconds)
entity_location += entity_axis.left() * (current_target_strafe * Game::instance()->g_strafespeed->value());
}
+ entity_movement = target_thrust;
+ entity_movement = math::max(entity_movement, fabs(current_target_pitch));
+ entity_movement = math::max(entity_movement, fabs(current_target_direction));
+ entity_movement = math::max(entity_movement, fabs(current_target_roll));
+ entity_movement = math::max(entity_movement, fabs(current_target_afterburner));
+ entity_movement = math::max(entity_movement, fabs(current_target_strafe));
+
if (entity_speed) {
entity_location += entity_axis.forward() * entity_speed * seconds;
entity_dirty = true;
- } else if ((current_target_pitch != 0.0f) || (current_target_direction != 0.0f) || (current_target_roll != 0.0f) || (current_target_afterburner != 0.0f) || (current_target_strafe != 0)) {
+ } else if (entity_movement > 0.0f) {
entity_dirty = true;
}
}