Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/ship.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index 664b557..05edf9c 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -1230,7 +1230,7 @@ void Ship::frame_autopilot_goto(const unsigned long elapsed, core::Entity *targe
if (direction.x() < 0) {
// target is behind the ship
- target_direction = math::sgnf(direction.y());
+ target_direction = (direction.y() > 0 ? 1.0f : -1.0f);
target_pitch = 0.0f;
} else if (direction.x() + MIN_DELTA < 1.0f) {
@@ -1359,7 +1359,7 @@ void Ship::frame_autopilot_formation(const unsigned long elapsed, core::Entity *
if (reference.forward().x() < 0) {
// target is behind the ship
- target_direction = math::sgnf(reference.forward().y());
+ target_direction = (reference.forward().y() > 0 ? 1.0f : -1.0f);
target_pitch = 0.0f;
} else if (reference.forward().x() + MIN_DELTA < 1.0f) {
@@ -1375,7 +1375,7 @@ void Ship::frame_autopilot_formation(const unsigned long elapsed, core::Entity *
if (reference.up().z() < 0.0f) {
// upward-down
- target_roll = math::sgnf(reference.up().y());
+ target_roll = (reference.up().y() > 0 ? 1.0f : 0.0f);
} else if (reference.up().z() + MIN_DELTA < 1.0f) {
target_roll = reference.up().y();