diff options
author | Stijn Buys <ingar@osirion.org> | 2015-02-28 22:52:22 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2015-02-28 22:52:22 +0000 |
commit | b656bec7d70e9ebb4bd809c32178a083e339f96e (patch) | |
tree | 653732d3264f9733e810329ffa55793346117cbb /src | |
parent | 9a5af746d505625d49130d74da61a59af8cda4a4 (diff) |
Disable mouse control while the camera is in freelook.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/input.cc | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/client/input.cc b/src/client/input.cc index 85d8526..a779ec8 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -1043,19 +1043,14 @@ void frame() { case render::Camera::Track: case render::Camera::Cockpit: - if (mouse_control) - { - local_direction = 0.0f; - local_pitch = 0.0f; - - // enable autopilot override - local_controlflags = local_controlflags | core::EntityControlable::ControlFlagOverride; - } else - { - // disable autopilot override - local_controlflags = local_controlflags & ~core::EntityControlable::ControlFlagOverride; - } + + // disable local control + local_direction = 0.0f; + local_pitch = 0.0f; + // disable autopilot override + local_controlflags = local_controlflags & ~core::EntityControlable::ControlFlagOverride; + render::camera().set_freelook_direction(180.0f * mouse_direction); render::camera().set_freelook_pitch(90.0f * mouse_pitch); @@ -1067,7 +1062,7 @@ void frame() render::camera().set_freelook_direction(180.0f * mouse_direction); render::camera().set_freelook_pitch(90.0f * mouse_pitch); - + // disable autopilot override local_controlflags = local_controlflags & ~core::EntityControlable::ControlFlagOverride; break; |