From fbf6e910a35f48df62d79ffc691385b0e6a1c413 Mon Sep 17 00:00:00 2001 From: Imple Lee <80144331+ImpleLee@users.noreply.github.com> Date: Fri, 18 Oct 2024 00:45:37 +0800 Subject: [PATCH] Fix a wierd bug (#1161) Steps to reproduce: 1. reset everything in custom game 2. restart the game 3. go to the custom game scene 4. go to the custom sequence scene and set a new sequence 5. leave the scene and go to the custom game scene 6. begin to clear Unintended behavior: The sequence is still the default old sequence (7-bag) Intended behavior: The sequence is the newly set sequence Rationale: The bug was introduced by #1139. It deleted a line of `apply_locals()` which I wrongly believed that the custom modes will execute initialize() anyway, but it turned out initialization is only executed during the start of the whole game. The patch is simple: just add back the deleted line --- parts/scenes/customGame.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index 77726598..3c15b8a3 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -145,6 +145,7 @@ local function _play(mode) end end saveFile(CUSTOMGAME_LOCAL.customenv,'conf/customEnv') + apply_locals() loadGame('custom_'..mode,true) end