From de731b02994765e9fad7e236d44839c7d2dca0b7 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 14 Aug 2016 12:41:09 -0400 Subject: [PATCH] Move save_dir back into cur_savegame and update submodules --- library/Core.cpp | 8 ++++---- library/RemoteTools.cpp | 2 +- library/modules/World.cpp | 2 +- library/xml | 2 +- plugins/isoworldremote.cpp | 4 ++-- plugins/remotefortressreader.cpp | 2 +- plugins/rendermax/renderer_light.cpp | 4 ++-- scripts | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/library/Core.cpp b/library/Core.cpp index 975290e52..fb1dd80bb 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -2107,7 +2107,7 @@ void Core::handleLoadAndUnloadScripts(color_ostream& out, state_change_event eve if (!df::global::world) return; - std::string rawFolder = "data/save/" + (df::global::world->save_dir) + "/raw/"; + std::string rawFolder = "data/save/" + (df::global::world->cur_savegame.save_dir) + "/raw/"; auto i = table.find(event); if ( i != table.end() ) { @@ -2167,9 +2167,9 @@ void Core::onStateChange(color_ostream &out, state_change_event event) case SC_WORLD_UNLOADED: case SC_MAP_LOADED: case SC_MAP_UNLOADED: - if (world && world->save_dir.size()) + if (world && world->cur_savegame.save_dir.size()) { - std::string save_dir = "data/save/" + world->save_dir; + std::string save_dir = "data/save/" + world->cur_savegame.save_dir; std::string evtlogpath = save_dir + "/events-dfhack.log"; std::ofstream evtlog; evtlog.open(evtlogpath, std::ios_base::app); // append @@ -2187,7 +2187,7 @@ void Core::onStateChange(color_ostream &out, state_change_event event) evtlog << timebuf; evtlog << "DFHack " << Version::git_description() << " on " << ostype << "; "; evtlog << "cwd md5: " << md5w.getHashFromString(getHackPath()).substr(0, 10) << "; "; - evtlog << "save: " << world->save_dir << "; "; + evtlog << "save: " << world->cur_savegame.save_dir << "; "; evtlog << sc_event_name(event) << "; "; if (gametype) evtlog << "game type " << ENUM_KEY_STR(game_type, *gametype) << " (" << *gametype << ")"; diff --git a/library/RemoteTools.cpp b/library/RemoteTools.cpp index 909ad9133..77374ea0c 100644 --- a/library/RemoteTools.cpp +++ b/library/RemoteTools.cpp @@ -386,7 +386,7 @@ static command_result GetWorldInfo(color_ostream &stream, if (df::global::gametype) gt = *df::global::gametype; - out->set_save_dir(world->save_dir); + out->set_save_dir(world->cur_savegame.save_dir); if (world->world_data->name.has_name) describeName(out->mutable_world_name(), &world->world_data->name); diff --git a/library/modules/World.cpp b/library/modules/World.cpp index fcf516f4e..3be400515 100644 --- a/library/modules/World.cpp +++ b/library/modules/World.cpp @@ -151,7 +151,7 @@ void World::SetCurrentWeather(uint8_t weather) string World::ReadWorldFolder() { - return world->save_dir; + return world->cur_savegame.save_dir; } bool World::isFortressMode(df::game_type t) diff --git a/library/xml b/library/xml index d5036d833..a8b3349ee 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit d5036d8336d266bcb13e27e702a0acada01227a4 +Subproject commit a8b3349ee1e03cc979497eeb95e59f7f59552691 diff --git a/plugins/isoworldremote.cpp b/plugins/isoworldremote.cpp index bd3433b27..017fb45f6 100644 --- a/plugins/isoworldremote.cpp +++ b/plugins/isoworldremote.cpp @@ -198,7 +198,7 @@ static command_result GetEmbarkInfo(color_ostream &stream, const MapRequest *in, return CR_OK; } if (in->has_save_folder()) { //If no save folder is given, it means we don't care. - if (!(in->save_folder() == world->save_dir || in->save_folder() == "ANY")) { //isoworld has a different map loaded, don't bother trying to load tiles for it, we don't have them. + if (!(in->save_folder() == world->cur_savegame.save_dir || in->save_folder() == "ANY")) { //isoworld has a different map loaded, don't bother trying to load tiles for it, we don't have them. out->set_available(false); return CR_OK; } @@ -345,7 +345,7 @@ static command_result GetRawNames(color_ostream &stream, const MapRequest *in, R return CR_OK; } if (in->has_save_folder()) { //If no save folder is given, it means we don't care. - if (!(in->save_folder() == world->save_dir || in->save_folder() == "ANY")) { //isoworld has a different map loaded, don't bother trying to load tiles for it, we don't have them. + if (!(in->save_folder() == world->cur_savegame.save_dir || in->save_folder() == "ANY")) { //isoworld has a different map loaded, don't bother trying to load tiles for it, we don't have them. out->set_available(false); return CR_OK; } diff --git a/plugins/remotefortressreader.cpp b/plugins/remotefortressreader.cpp index 5edb8e248..8a2428adb 100644 --- a/plugins/remotefortressreader.cpp +++ b/plugins/remotefortressreader.cpp @@ -1571,7 +1571,7 @@ static command_result GetMapInfo(color_ostream &stream, const EmptyMessage *in, out->set_block_pos_z(pos_z); out->set_world_name(DF2UTF(Translation::TranslateName(&df::global::world->world_data->name, false))); out->set_world_name_english(DF2UTF(Translation::TranslateName(&df::global::world->world_data->name, true))); - out->set_save_name(df::global::world->save_dir); + out->set_save_name(df::global::world->cur_savegame.save_dir); return CR_OK; } diff --git a/plugins/rendermax/renderer_light.cpp b/plugins/rendermax/renderer_light.cpp index 48dcb8223..f0f3c92cf 100644 --- a/plugins/rendermax/renderer_light.cpp +++ b/plugins/rendermax/renderer_light.cpp @@ -1171,9 +1171,9 @@ void lightingEngineViewscreen::defaultSettings() void lightingEngineViewscreen::loadSettings() { std::string rawFolder; - if(df::global::world->save_dir!="") + if(df::global::world->cur_savegame.save_dir!="") { - rawFolder= "data/save/" + (df::global::world->save_dir) + "/raw/"; + rawFolder= "data/save/" + (df::global::world->cur_savegame.save_dir) + "/raw/"; } else { diff --git a/scripts b/scripts index 274e7c372..955db4654 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 274e7c372c83611d8fad53345a0cb9ad2a1f10df +Subproject commit 955db46549779a411da563252dc98c4c242de489