diff options
author | Stijn Buys <ingar@osirion.org> | 2013-10-20 11:20:16 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-10-20 11:20:16 +0000 |
commit | 55f9c240525d77686d00d43f627db7892f27e1de (patch) | |
tree | 471dde97eb5dc311c25cf126fcdb487940b5783b /src/game | |
parent | 186c38fed80afb3dc1ef2f54b144846505297506 (diff) |
Allow docking even if ControlFlagOverride is set.
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/base/ship.cc | 26 |
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()); + } } } |