Update possible invalid camera again

This commit is contained in:
Benau 2019-02-03 11:21:33 +08:00
parent 18c9ef6adc
commit 11dafe470c

View File

@ -1239,6 +1239,12 @@ void ClientLobby::changeSpectateTarget(PlayerAction action, int value,
if (cam->getType() != Camera::CM_TYPE_NORMAL) if (cam->getType() != Camera::CM_TYPE_NORMAL)
Camera::changeCamera(0, 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 // Copied from EventHandler::processGUIAction
const bool pressed_down = value > Input::MAX_VALUE * 2 / 3; const bool pressed_down = value > Input::MAX_VALUE * 2 / 3;