Fix test compile errors

This commit is contained in:
2025-05-09 14:03:20 -05:00
parent 757532b7af
commit 813edf0c64
4 changed files with 5 additions and 4 deletions

View File

@@ -2866,6 +2866,7 @@ bool save_check(std::string which_dlog, bool allow_no) {
return false; return false;
change_made = false; change_made = false;
town->set_up_lights(); town->set_up_lights();
store_current_terrain_state();
save_scenario(); save_scenario();
return true; return true;
} }

View File

@@ -1080,9 +1080,7 @@ struct overrides_sheet {
extern std::string scenario_temp_dir_name; extern std::string scenario_temp_dir_name;
extern fs::path scenDir; extern fs::path scenDir;
extern void store_current_terrain_state();
void save_scenario(bool rename) { void save_scenario(bool rename) {
store_current_terrain_state();
fs::path toFile = scenario.scen_file; fs::path toFile = scenario.scen_file;
if(rename || toFile.empty()) { if(rename || toFile.empty()) {
fs::path def = scenario.scen_file; fs::path def = scenario.scen_file;

View File

@@ -456,9 +456,11 @@ void handle_menu_choice(eMenu item_hit) {
update_edit_menu(); update_edit_menu();
break; break;
case eMenu::FILE_SAVE: case eMenu::FILE_SAVE:
store_current_terrain_state();
save_scenario(); save_scenario();
break; break;
case eMenu::FILE_SAVE_AS: case eMenu::FILE_SAVE_AS:
store_current_terrain_state();
save_scenario(true); save_scenario(true);
break; break;
case eMenu::FILE_NEW: case eMenu::FILE_NEW:

View File

@@ -184,8 +184,8 @@ TEST_CASE("Loading a new-format scenario record") {
CHECK(scen.out_sec_start == loc(1,3)); CHECK(scen.out_sec_start == loc(1,3));
CHECK(scen.out_start == loc(12,21)); CHECK(scen.out_start == loc(12,21));
CHECK(scen.default_ground == 2); CHECK(scen.default_ground == 2);
CHECK(scen.last_out_edited == loc(0,0)); CHECK(scen.editor_state.last_out_edited == loc(0,0));
CHECK(scen.last_town_edited == 0); CHECK(scen.editor_state.last_town_edited == 0);
CHECK(scen.init_spec == -1); CHECK(scen.init_spec == -1);
} }
SECTION("With a different icon in the intro dialog") { SECTION("With a different icon in the intro dialog") {