Skip to content

Commit

Permalink
Fix for glued cockpit
Browse files Browse the repository at this point in the history
Fixes issue when cockpit becomes "glued" on random occasions.
  • Loading branch information
Max5377 committed Sep 27, 2023
1 parent 1957b8d commit a128b00
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ShipCockpit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a128b00

Please sign in to comment.