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, 8 insertions, 3 deletions
diff --git a/src/game/ship.cc b/src/game/ship.cc
index b82b7a8..7c3d21d 100644
--- a/src/game/ship.cc
+++ b/src/game/ship.cc
@@ -43,9 +43,14 @@ void Ship::frame(float seconds)
entity_thrust = 1.0f;
// update direction
- float direction_offset = degrees180f(target_direction - entity_direction);
- float d = ship_shipmodel->turnspeed() * seconds * direction_offset;
- entity_direction = degrees360f(entity_direction + d);
+ if (target_direction > 1.0f)
+ target_direction = 1.0f;
+ else if (target_direction < -1.0f)
+ target_direction = -1.0f;
+
+ // turnspeed is rotations per second
+ float direction_offset = 360.0f * ship_shipmodel->turnspeed() * seconds * target_direction;
+ entity_direction = degrees360f(entity_direction + direction_offset);
// update speed
if (entity_speed < entity_thrust * ship_shipmodel->maxspeed()) {