From 332b360232e45a88781ef81d22ff8f07950c0a70 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 14 Jun 2025 11:49:34 -0500 Subject: [PATCH] fix cTerrainAction::showChangeSite() --- src/scenedit/scen.undo.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/scenedit/scen.undo.cpp b/src/scenedit/scen.undo.cpp index f06afa47..478bcad3 100644 --- a/src/scenedit/scen.undo.cpp +++ b/src/scenedit/scen.undo.cpp @@ -44,15 +44,19 @@ cTerrainAction::cTerrainAction(std::string name, location where, bool reversed) void cTerrainAction::showChangeSite() { if(area.is_town){ - cur_town = area.town_num; + set_current_town(area.town_num); + start_town_edit(); }else{ - cur_out = area.out_sec; + set_current_out(area.out_sec); + start_out_edit(); } - editing_town = area.is_town; - // TODO this isn't working and I don't know why: - cen_x = area.where.x; - cen_y = area.where.y; + // If the last stored view location of this town/section can't see the change site, + // move the view center + if(!((abs((short) (cen_x - area.where.x)) <=4) && (abs((short) (cen_y - area.where.y)) <= 4))){ + cen_x = area.where.x; + cen_y = area.where.y; + } redraw_screen(); }