From fb227d62e699ebaea6e428f570bedc684873f15b Mon Sep 17 00:00:00 2001
From: Stijn Buys <ingar@osirion.org>
Date: Sun, 11 May 2008 08:39:40 +0000
Subject: fix movement in local game, fix camera cockpit mode offset

---
 src/game/ship.cc | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

(limited to 'src/game')

diff --git a/src/game/ship.cc b/src/game/ship.cc
index 5c36205..e864aba 100644
--- a/src/game/ship.cc
+++ b/src/game/ship.cc
@@ -57,9 +57,7 @@ void Ship::frame(float seconds)
 			current_target_pitch = target_pitch;
 	}
 	
-	if (fabs(seconds*current_target_pitch) < 0.00005f) {
-		current_target_pitch = 0.0f;
-	} else {
+	if (fabs(seconds*current_target_pitch) > 0.0f) {
 		math::clamp(current_target_pitch, -1.0f, 1.0f);
 		float pitch_offset =  seconds * current_target_pitch;
 		entity_axis.change_pitch(360.0f * ship_shipmodel->turnspeed() * pitch_offset);
@@ -78,9 +76,7 @@ void Ship::frame(float seconds)
 			current_target_direction = target_direction;
 		}
 	}
-	if (fabs(seconds*current_target_direction) < 0.00005f) {
-		current_target_direction = 0.0f;
-	} else {
+	if (fabs(seconds*current_target_direction) > 0.0f ) {
 		math::clamp(current_target_direction, -1.0f, 1.0f);
 		float direction_offset = seconds * current_target_direction;
 		entity_axis.change_direction(360.0f * ship_shipmodel->turnspeed() * direction_offset);
@@ -97,9 +93,7 @@ void Ship::frame(float seconds)
 		if (current_target_roll < target_roll)
 			current_target_roll = target_roll;
 	}
-	if (fabs(current_target_roll) < 0.00005f) {
-		current_target_roll = 0.0f;
-	} else {
+	if (fabs(current_target_roll) > 0.0f) {
 		math::clamp(current_target_roll, -1.0f, 1.0f);
 		float roll_offset = seconds * current_target_roll;
 		entity_axis.change_roll(360.0f * ship_shipmodel->turnspeed() * roll_offset);
-- 
cgit v1.2.3