change order of state change event processing

this will cause persistent data storage to load _before_ `SC_WORLD_LOADED` events are sent to scripts and plugins
develop
Kelly Kinkade 2023-01-06 21:55:42 -06:00
parent 3e4861b54b
commit 51bb5589de
1 changed files with 5 additions and 4 deletions

@ -2197,6 +2197,11 @@ void Core::onStateChange(color_ostream &out, state_change_event event)
std::cerr << "loaded map in prerelease build" << std::endl;
}
if (event == SC_WORLD_LOADED)
{
doLoadData(out);
}
EventManager::onStateChange(out, event);
buildings_onStateChange(out, event);
@ -2211,10 +2216,6 @@ void Core::onStateChange(color_ostream &out, state_change_event event)
{
Persistence::Internal::clear();
}
if (event == SC_WORLD_LOADED)
{
doLoadData(out);
}
}
void Core::doSaveData(color_ostream &out)