From 90f7a0a8b216edc3138734cb2a0d18adf85c223c Mon Sep 17 00:00:00 2001 From: Max5377 <69468517+Max5377@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:24:23 +0300 Subject: [PATCH] Fix for glued cockpit Fixes issue when cockpit becomes "glued" on random occasions. --- src/ShipCockpit.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ShipCockpit.cpp b/src/ShipCockpit.cpp index 60e738addee..d7d08c49df3 100644 --- a/src/ShipCockpit.cpp +++ b/src/ShipCockpit.cpp @@ -64,13 +64,18 @@ inline void ShipCockpit::resetInternalCameraController() void ShipCockpit::Update(const Player *player, float timeStep) { - m_transform = matrix4x4d::Identity(); - + //Check if current view is exterior since we don't need to update cockpit + //because player can't see it + if (Pi::game->GetWorldView()->shipView->IsExteriorView()) + { + return; + } if (m_icc == nullptr) { // I don't know where to put this resetInternalCameraController(); } + m_transform = matrix4x4d::Identity(); double rotX; double rotY; m_icc->getRots(rotX, rotY);