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:
parent
b5aca012eb
commit
dd09c9b362
1 changed files with 3 additions and 1 deletions
|
@ -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…
Reference in a new issue