From 97fef47204cb34e6a015dae22810f155b5b984a6 Mon Sep 17 00:00:00 2001 From: Miran Date: Sat, 7 Dec 2024 05:13:24 +0100 Subject: [PATCH] fix_cleo_save_clearing --- source/CScriptEngine.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/CScriptEngine.cpp b/source/CScriptEngine.cpp index a27f30f1..b26a8e7d 100644 --- a/source/CScriptEngine.cpp +++ b/source/CScriptEngine.cpp @@ -1078,15 +1078,14 @@ namespace CLEO void CScriptEngine::LoadState(int saveSlot) { memset(CleoVariables, 0, sizeof(CleoVariables)); - - if(saveSlot == -1) return; - - auto saveFile = FS::path(Filepath_Cleo).append(StringPrintf("cleo_saves\\cs%d.sav", saveSlot)).string(); - safe_info = nullptr; stopped_info = nullptr; safe_header.n_saved_threads = safe_header.n_stopped_threads = 0; + if(saveSlot == -1) return; // new game started + + auto saveFile = FS::path(Filepath_Cleo).append(StringPrintf("cleo_saves\\cs%d.sav", saveSlot)).string(); + // load cleo saving file try {