don't read cur_savegame.save_dir when invalid

develop
Myk Taylor 2023-04-14 01:22:12 -07:00
parent b9d95c5a0b
commit 52b869d908
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

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