1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Trigger a game ended state handler before loading to allow menu scripts to do cleanup

This commit is contained in:
uramer 2024-01-30 18:58:15 +01:00
parent 2008f35e57
commit ad8a05e2a1

View File

@ -449,9 +449,12 @@ void MWState::StateManager::loadGame(const Character* character, const std::file
{
try
{
// let menu scripts do cleanup
mState = State_Ended;
MWBase::Environment::get().getLuaManager()->gameEnded();
if (mState != State_Ended)
{
// let menu scripts do cleanup
mState = State_Ended;
MWBase::Environment::get().getLuaManager()->gameEnded();
}
cleanup();