1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 14:39:43 +00:00

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

This commit is contained in:
uramer 2024-01-13 00:42:55 +01:00
parent b5aca012eb
commit dd09c9b362

View file

@ -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();