Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-10-20 11:20:16 +0000
committerStijn Buys <ingar@osirion.org>2013-10-20 11:20:16 +0000
commit55f9c240525d77686d00d43f627db7892f27e1de (patch)
tree471dde97eb5dc311c25cf126fcdb487940b5783b /src
parent186c38fed80afb3dc1ef2f54b144846505297506 (diff)
Allow docking even if ControlFlagOverride is set.
Diffstat (limited to 'src')
-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());
+ }
}
}