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/base')
-rw-r--r--src/game/base/ship.cc26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index bc2b318..75656dc 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -646,7 +646,7 @@ void Ship::frame(const unsigned long elapsed)
/* -- autopilot -------------------------------------------- */
- if (has_autopilot_flag(Ship::AutoPilotEnabled) && !has_target_controlflag(core::EntityControlable::ControlFlagOverride)) {
+ if (has_autopilot_flag(Ship::AutoPilotEnabled)) {
if ((state() == core::Entity::Normal) || (state() == core::Entity::Impulse) || (state() == core::Entity::ImpulseInitiate)) {
frame_autopilot(elapsed);
@@ -1037,15 +1037,23 @@ void Ship::frame_autopilot(const unsigned long elapsed)
const float distance = math::distance(location(), autopilot_target()->location());
const float dock_distance = (autopilot_target()->moduletype() == planet_enttype ? r + PLANET_SAFE_DISTANCE : r);
- // thruster and speed control
- if (has_autopilot_flag(AutoPilotFormation) && (distance < 4.0f * r)) {
- frame_autopilot_formation(elapsed, autopilot_target());
-
- } else if (has_autopilot_flag(AutoPilotDock) && (distance < dock_distance)) {
- frame_autopilot_dock(elapsed, autopilot_target());
-
+ if (!has_target_controlflag(core::EntityControlable::ControlFlagOverride)) {
+
+ // thruster and speed control
+ if (has_autopilot_flag(AutoPilotFormation) && (distance < 4.0f * r)) {
+ frame_autopilot_formation(elapsed, autopilot_target());
+
+ } else if (has_autopilot_flag(AutoPilotDock) && (distance < dock_distance)) {
+ frame_autopilot_dock(elapsed, autopilot_target());
+
+ } else {
+ frame_autopilot_goto(elapsed, autopilot_target());
+ }
} else {
- frame_autopilot_goto(elapsed, autopilot_target());
+ // docking has to work even if ControlFlagOverride is set
+ if (has_autopilot_flag(AutoPilotDock) && (distance < dock_distance)) {
+ frame_autopilot_dock(elapsed, autopilot_target());
+ }
}
}