Merge pull request #3228 from myk002/myk_rawfolder

don't read cur_savegame.save_dir when invalid
develop
Myk 2023-04-15 17:08:13 -07:00 committed by GitHub
commit 828a9eb6c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

@ -2083,7 +2083,8 @@ void Core::handleLoadAndUnloadScripts(color_ostream& out, state_change_event eve
if (!df::global::world)
return;
std::string rawFolder = "save/" + (df::global::world->cur_savegame.save_dir) + "/init";
std::string rawFolder = !isWorldLoaded() ? "" : "save/" + World::ReadWorldFolder() + "/init";
auto i = table.find(event);
if ( i != table.end() ) {