Fix scenario editor build

This commit is contained in:
2015-01-10 20:12:49 -05:00
parent 6b107f8273
commit bd0dc55995
5 changed files with 4 additions and 7 deletions

View File

@@ -3390,7 +3390,7 @@ bool save_check(std::string which_dlog) {
else if(choice == "cancel")
return false;
town->set_up_lights();
save_scenario();
save_scenario(scenario.scen_file);
return true;
}

View File

@@ -1614,7 +1614,6 @@ bool build_scenario() {
cur_town = which_town;
scenario.addTown<cBigTown>();
town->town_name = "Large town";
save_scenario();
}
for(i = 0; i < med; i++) {
which_town = scenario.num_towns;
@@ -1624,7 +1623,6 @@ bool build_scenario() {
cur_town = which_town;
scenario.addTown<cMedTown>();
town->town_name = "Medium town";
save_scenario();
}
for(i = 0; i < small; i++) {
which_town = scenario.num_towns;
@@ -1634,7 +1632,6 @@ bool build_scenario() {
cur_town = which_town;
scenario.addTown<cTinyTown>();
town->town_name = "Small town";
save_scenario();
}
cur_town = 0;
town = scenario.towns[0];

View File

@@ -98,7 +98,7 @@ void save_scenario(fs::path toFile) {
for(size_t i = 0; i < scenario.towns.size(); i++) {
std::string file_basename = 't' + std::to_string(i);
// First the main data.
std::ostream town = scen_file.newFile("scenario/towns/" + file_basename + ".xml");
std::ostream& town = scen_file.newFile("scenario/towns/" + file_basename + ".xml");
// Then the map.
std::ostream& town_map = scen_file.newFile("scenario/towns/" + file_basename + ".map");

View File

@@ -233,7 +233,7 @@ void handle_menu_choice(eMenu item_hit) {
break;
case eMenu::FILE_SAVE:
town->set_up_lights();
save_scenario();
save_scenario(scenario.scen_file);
break;
case eMenu::FILE_NEW:
if(build_scenario()) {

View File

@@ -1155,7 +1155,7 @@ void delete_last_town() {
scenario.town_data_size[scenario.num_towns][2] = 0;
scenario.town_data_size[scenario.num_towns][3] = 0;
scenario.town_data_size[scenario.num_towns][4] = 0;
save_scenario();
save_scenario(scenario.scen_file);
}
cTown* pick_import_town(short def) {