Rename the world substruct with the save directory name.

develop
Alexander Gavrilov 2012-03-14 10:56:30 +04:00
parent 0d19c6a112
commit a05cbcc2de
4 changed files with 9 additions and 8 deletions

1
.gitignore vendored

@ -34,6 +34,7 @@ build/bin
build/library
build/tools
build/plugins
build/depends
#ignore Kdevelop stuff
.kdev4

@ -209,7 +209,7 @@ void World::SetCurrentWeather(uint8_t weather)
string World::ReadWorldFolder()
{
return world->unk_192bd8.save_dir;
return world->cur_savegame.save_dir;
}
static PersistentDataItem dataFromHFig(df::historical_figure *hfig)

@ -1 +1 @@
Subproject commit 24e809abe07eb139c9f53c358ed3fbd3d8075410
Subproject commit 136181f067a0a5ed19a19c9f98eece41003fe372

@ -33,9 +33,9 @@ static command_result feature(color_ostream &out, vector <string> &parameters)
{
if (parameters.size() != 1)
return CR_WRONG_USAGE;
for (size_t i = 0; i < world->unk_192bd8.map_features.size(); i++)
for (size_t i = 0; i < world->cur_savegame.map_features.size(); i++)
{
df::feature_init *feature_init = world->unk_192bd8.map_features[i];
df::feature_init *feature_init = world->cur_savegame.map_features[i];
string name;
feature_init->getName(&name);
out.print("Feature #%i (\"%s\", type %s) is %s\n", i, name.c_str(), ENUM_KEY_STR(feature_type, feature_init->getType()), feature_init->flags.is_set(feature_init_flags::Discovered) ? "discovered" : "hidden");
@ -46,12 +46,12 @@ static command_result feature(color_ostream &out, vector <string> &parameters)
if (parameters.size() != 2)
return CR_WRONG_USAGE;
size_t i = atoi(parameters[1].c_str());
if ((i < 0) || (i >= world->unk_192bd8.map_features.size()))
if ((i < 0) || (i >= world->cur_savegame.map_features.size()))
{
out.print("No such feature!\n");
return CR_FAILURE;
}
df::feature_init *feature_init = world->unk_192bd8.map_features[i];
df::feature_init *feature_init = world->cur_savegame.map_features[i];
if (feature_init->flags.is_set(feature_init_flags::Discovered))
{
out.print("Selected feature is already discovered!\n");
@ -67,12 +67,12 @@ static command_result feature(color_ostream &out, vector <string> &parameters)
if (parameters.size() != 2)
return CR_WRONG_USAGE;
size_t i = atoi(parameters[1].c_str());
if ((i < 0) || (i >= world->unk_192bd8.map_features.size()))
if ((i < 0) || (i >= world->cur_savegame.map_features.size()))
{
out.print("No such feature!\n");
return CR_FAILURE;
}
df::feature_init *feature_init = world->unk_192bd8.map_features[i];
df::feature_init *feature_init = world->cur_savegame.map_features[i];
if (!feature_init->flags.is_set(feature_init_flags::Discovered))
{
out.print("Selected feature is already hidden!\n");