From af8fe59d806f801c728cc6b23a5ca58f234228a7 Mon Sep 17 00:00:00 2001 From: Marco Oliveira Date: Sun, 18 Oct 2020 16:46:30 -0300 Subject: [PATCH 1/3] Server save script improvements --- data/globalevents/scripts/serversave.lua | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/data/globalevents/scripts/serversave.lua b/data/globalevents/scripts/serversave.lua index f6210abf28..1163896eb7 100644 --- a/data/globalevents/scripts/serversave.lua +++ b/data/globalevents/scripts/serversave.lua @@ -1,14 +1,19 @@ local function ServerSave() - if configManager.getBoolean(configKeys.SERVER_SAVE_CLEAN_MAP) then - cleanMap() - end - - if configManager.getBoolean(configKeys.SERVER_SAVE_CLOSE) then - Game.setGameState(GAME_STATE_CLOSED) - end - if configManager.getBoolean(configKeys.SERVER_SAVE_SHUTDOWN) then Game.setGameState(GAME_STATE_SHUTDOWN) + else + local closeAtServerSave = configManager.getBoolean(configKeys.SERVER_SAVE_CLOSE) + if closeAtServerSave then + Game.setGameState(GAME_STATE_CLOSED) + end + + if configManager.getBoolean(configKeys.SERVER_SAVE_CLEAN_MAP) then + cleanMap() + end + + if closeAtServerSave then + Game.setGameState(GAME_STATE_NORMAL) + end end end From 02afd8f52440aef4ce19a4e3593f0c2459f7db2b Mon Sep 17 00:00:00 2001 From: Marco Oliveira Date: Fri, 17 Sep 2021 21:24:32 -0300 Subject: [PATCH 2/3] Update serversave.lua --- data/globalevents/scripts/serversave.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/globalevents/scripts/serversave.lua b/data/globalevents/scripts/serversave.lua index 1163896eb7..d8066fd019 100644 --- a/data/globalevents/scripts/serversave.lua +++ b/data/globalevents/scripts/serversave.lua @@ -15,6 +15,8 @@ local function ServerSave() Game.setGameState(GAME_STATE_NORMAL) end end + + saveServer() end local function ServerSaveWarning(time) From 51487185a7851ffcefe78a3d325851eb244dac72 Mon Sep 17 00:00:00 2001 From: Marco Oliveira Date: Sat, 18 Sep 2021 10:39:49 -0300 Subject: [PATCH 3/3] Update serversave.lua --- data/globalevents/scripts/serversave.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/globalevents/scripts/serversave.lua b/data/globalevents/scripts/serversave.lua index d8066fd019..5a2c95638c 100644 --- a/data/globalevents/scripts/serversave.lua +++ b/data/globalevents/scripts/serversave.lua @@ -7,6 +7,8 @@ local function ServerSave() Game.setGameState(GAME_STATE_CLOSED) end + saveServer() + if configManager.getBoolean(configKeys.SERVER_SAVE_CLEAN_MAP) then cleanMap() end @@ -15,8 +17,6 @@ local function ServerSave() Game.setGameState(GAME_STATE_NORMAL) end end - - saveServer() end local function ServerSaveWarning(time)