Don't save global storage if global scripts didn't run

ini_importer_tests
uramer 12 months ago
parent b5aca012eb
commit dd09c9b362

@ -141,7 +141,8 @@ namespace MWLua
void LuaManager::savePermanentStorage(const std::filesystem::path& userConfigPath)
{
mGlobalStorage.save(userConfigPath / "global_storage.bin");
if (mGlobalScriptsStarted)
mGlobalStorage.save(userConfigPath / "global_storage.bin");
mPlayerStorage.save(userConfigPath / "player_storage.bin");
}
@ -318,6 +319,7 @@ namespace MWLua
mPlayer.getRefData().setLuaScripts(nullptr);
mPlayer = MWWorld::Ptr();
}
mGlobalStorage.setActive(true);
mGlobalStorage.clearTemporaryAndRemoveCallbacks();
mGlobalStorage.setActive(false);
mPlayerStorage.clearTemporaryAndRemoveCallbacks();

Loading…
Cancel
Save