diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/ship.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/ship.cc b/src/game/ship.cc index a1d4531..525bf71 100644 --- a/src/game/ship.cc +++ b/src/game/ship.cc @@ -47,9 +47,9 @@ void Ship::frame(float seconds) // update pitch math::clamp(target_pitch, -1.0f, 1.0f); - if (current_target_pitch < target_pitch) { + if (current_target_pitch - target_pitch < 0) { current_target_pitch += direction_change_speed * seconds; - } else if (current_target_pitch > target_pitch) { + } else if (current_target_pitch - target_pitch > 0) { current_target_pitch -= direction_change_speed * seconds; } if (fabs(current_target_pitch) < direction_change_speed * seconds) { @@ -62,9 +62,9 @@ void Ship::frame(float seconds) // update direction math::clamp(target_direction, -1.0f, 1.0f); - if (current_target_direction < target_direction) { + if (current_target_direction - target_direction < 0) { current_target_direction += direction_change_speed * seconds; - } else if (current_target_direction > target_direction) { + } else if (current_target_direction - target_direction > 0) { current_target_direction -= direction_change_speed * seconds; } if (fabs(current_target_direction) < direction_change_speed * seconds) { @@ -77,9 +77,9 @@ void Ship::frame(float seconds) // update roll math::clamp(target_roll, -1.0f, 1.0f); - if (current_target_roll < target_roll) { + if (current_target_roll - target_roll < 0) { current_target_roll += direction_change_speed * seconds; - } else if (current_target_roll > target_roll) { + } else if (current_target_roll - target_roll > 0) { current_target_roll -= direction_change_speed * seconds; } if (fabs(current_target_roll) < direction_change_speed * seconds) { |