Merge pull request #2568 from ab9rf/5005-persistence

fix persistence
develop
Myk 2023-01-06 21:50:20 -08:00 committed by GitHub
commit f20180de47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 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)

@ -387,7 +387,7 @@ static std::string filterSaveFileName(std::string s)
static std::string getSaveFilePath(const std::string &world, const std::string &name)
{
return "data/save/" + world + "/dfhack-" + filterSaveFileName(name) + ".dat";
return "save/" + world + "/dfhack-" + filterSaveFileName(name) + ".dat";
}
#if defined(__GNUC__) && __GNUC__ < 5