Several little tweaks and fixes

- Fix some uninitialized fields getting populated with random data
- Fix identity of last edited town and outdoor section not being saved
- Fix editor sometimes saving to application directory instead of overwriting the loaded scenario
- Fix town specials being saved to outdoors list and vice versa
- Fix right-most column of map not being loaded properly
- Fix town entry node for start town being called after the first turn of the scenario
- Add option to call a special node at startup (right after the intro dialog)
This commit is contained in:
2015-06-01 22:43:41 -04:00
parent 0849df0e28
commit 7dddcdb86e
13 changed files with 31 additions and 9 deletions

View File

@@ -696,6 +696,8 @@ static void readScenarioFromXml(ticpp::Document&& data, cScenario& scenario) {
int h;
game->GetText(&h);
scenario.outdoors.resize(scenario.outdoors.width(), h);
} else if(type == "on-init") {
game->GetText(&scenario.init_spec);
} else if(type == "start-town") {
game->GetText(&scenario.which_town_start);
// TODO: Make sure town is valid

View File

@@ -24,11 +24,10 @@ map_data load_map(std::istream& fin, bool isTown) {
int n = 0, col = 0;
eMapFeature curFeature = eMapFeature::NONE;
// vehicle_owned = true means the party owns it
bool vehicle_owned, found_something;
bool vehicle_owned;
for(char c : line) {
if(c == '#') break; // Found a comment
if(isblank(c)) continue;
found_something = true;
if(isdigit(c)) {
n *= 10;
n += c - '0';
@@ -85,6 +84,13 @@ map_data load_map(std::istream& fin, bool isTown) {
}
}
}
if(curFeature == eMapFeature::NONE)
data.set(col, row, n);
else {
if((curFeature == eMapFeature::BOAT || curFeature == eMapFeature::HORSE) && !vehicle_owned)
n += 10000;
data.addFeature(col, row, curFeature, n);
}
row++;
}
return data;