From b656bec7d70e9ebb4bd809c32178a083e339f96e Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 28 Feb 2015 22:52:22 +0000 Subject: Disable mouse control while the camera is in freelook. --- src/client/input.cc | 21 ++++++++------------- 1 file 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; -- cgit v1.2.3