From 11dafe470c500c316a42612ff5d5f675e3649e41 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 3 Feb 2019 11:21:33 +0800 Subject: [PATCH] Update possible invalid camera again --- src/network/protocols/client_lobby.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/network/protocols/client_lobby.cpp b/src/network/protocols/client_lobby.cpp index f928bcfbc..88cd7a4dc 100644 --- a/src/network/protocols/client_lobby.cpp +++ b/src/network/protocols/client_lobby.cpp @@ -1239,6 +1239,12 @@ void ClientLobby::changeSpectateTarget(PlayerAction action, int value, if (cam->getType() != Camera::CM_TYPE_NORMAL) Camera::changeCamera(0, Camera::CM_TYPE_NORMAL); + // Update if the camera again beacuse when race finished cam will be + // changed above and invalid + cam = Camera::getActiveCamera(); + if (!cam) + return; + // Copied from EventHandler::processGUIAction const bool pressed_down = value > Input::MAX_VALUE * 2 / 3;