From c0e162db68f7dc00502e7b160d64c11b346981f2 Mon Sep 17 00:00:00 2001 From: Michael Werle Date: Wed, 9 Oct 2024 20:21:47 +0900 Subject: [PATCH] fix: only reset view to WorldView when Player enters system Fixes #5935 Bug introduced in 99b0acdb9843d65fbb6f19e720c3e59a5abec86e, the 'onEnterSystem' event needs to check whether the ship which entered the system is the Player. --- data/libs/Player.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/libs/Player.lua b/data/libs/Player.lua index 52a591bb47..ad5e8be0a4 100644 --- a/data/libs/Player.lua +++ b/data/libs/Player.lua @@ -431,7 +431,8 @@ local onGameEnd = function () -- clean up for next game: end -local onEnterSystem = function () +local onEnterSystem = function (ship) + if not ship.IsPlayer() then return end -- Return to game view when we exit hyperspace if Engine.GetResetViewOnHyperspaceExit() and Game.CurrentView() ~= "world" then Game.SetView("world")