Move save_dir back into cur_savegame and update submodules

develop
lethosor 2016-08-14 12:41:09 -04:00
parent e965f5318f
commit de731b0299
8 changed files with 13 additions and 13 deletions

@ -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 << ")";

@ -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);

@ -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)

@ -1 +1 @@
Subproject commit d5036d8336d266bcb13e27e702a0acada01227a4
Subproject commit a8b3349ee1e03cc979497eeb95e59f7f59552691

@ -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;
}

@ -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;
}

@ -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
{

@ -1 +1 @@
Subproject commit 274e7c372c83611d8fad53345a0cb9ad2a1f10df
Subproject commit 955db46549779a411da563252dc98c4c242de489