From 4cd7368fbfe665d639eef3bc71590bd20377010d Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 7 May 2016 12:42:47 -0400 Subject: [PATCH] Some fixes to scenario dirty flag --- src/scenedit/scen.fileio.cpp | 2 ++ src/scenedit/scen.townout.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scenedit/scen.fileio.cpp b/src/scenedit/scen.fileio.cpp index 1312b808..ad24874c 100644 --- a/src/scenedit/scen.fileio.cpp +++ b/src/scenedit/scen.fileio.cpp @@ -1029,6 +1029,8 @@ void save_scenario(bool rename) { std::ostream& town_talk = scen_file.newFile("scenario/towns/talk" + std::to_string(i) + ".xml"); writeDialogueToXml(ticpp::Printer("talk.xml", town_talk), scenario.towns[i]->talking, i); } + + change_made = false; // Alright. At this point, check to see if the scenario was unpacked. if(fs::is_directory(toFile)) { diff --git a/src/scenedit/scen.townout.cpp b/src/scenedit/scen.townout.cpp index 28e68caf..7760faa0 100644 --- a/src/scenedit/scen.townout.cpp +++ b/src/scenedit/scen.townout.cpp @@ -22,7 +22,7 @@ #include "fileio.hpp" extern short cen_x, cen_y, overall_mode; -extern bool mouse_button_held,editing_town; +extern bool mouse_button_held,editing_town,change_made; extern short cur_viewing_mode; extern cTown* town; extern short mode_count,to_create,cur_town; @@ -1231,6 +1231,8 @@ bool new_town(short which_town) { town->terrain(i,j) = 4; } } + + change_made = true; return true; } @@ -1240,6 +1242,7 @@ void delete_last_town() { cTown* last_town = scenario.towns.back(); scenario.towns.pop_back(); delete last_town; + change_made = true; } cTown* pick_import_town() {