From 5db0c4ef709d81b2c438017488bbcce9669741d5 Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Fri, 17 Oct 2025 20:26:20 -0400 Subject: [PATCH] Add a setting to preserve wparam and landparam when changing walls and lands with the map editor --- mapeditor.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mapeditor.cpp b/mapeditor.cpp index 0d7d22e7..21077644 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -1334,6 +1334,7 @@ EX namespace mapeditor { int paintstatueid = 0; int radius = 0; string paintwhat_str = "clear monster"; + bool preserveparams = false; cellwalker copysource; @@ -1748,7 +1749,10 @@ EX namespace mapeditor { if(anyshiftclick) { c->land = laNone; c->wall = waNone; map_version++; break; } eLand last = c->land; c->land = eLand(paintwhat); - if(isIcyLand(c) && isIcyLand(last)) + if(preserveparams) { + // do nothing + } + else if(isIcyLand(c) && isIcyLand(last)) HEAT(c) += spillinc() / 100.; else if(last == laDryForest && c->land == laDryForest) c->landparam += spillinc(); @@ -1765,7 +1769,10 @@ EX namespace mapeditor { c->wall = eWall(anyshiftclick ? paintwhat_alt_wall : paintwhat); map_version++; - if(last != c->wall) { + if(preserveparams) { + // do nothing + } + else if(last != c->wall) { if(hasTimeout(c)) c->wparam = 10; else if(c->wall == waWaxWall) @@ -1775,7 +1782,7 @@ EX namespace mapeditor { c->wparam += spillinc(); if(c->wall == waEditStatue) { - c->wparam = paintstatueid; + if(!preserveparams) c->wparam = paintstatueid; c->mondir = cdir; } @@ -3382,6 +3389,9 @@ EX namespace mapeditor { dialog::addItem(XLAT("change the pattern/color of new Canvas cells"), 'c'); dialog::add_action_push(patterns::showPrePatternNoninstant); + dialog::addBoolItem_action(XLAT("preserve parameters when editing walls and lands"), preserveparams, 'P'); + dialog::addInfo(XLAT("(unexpected parameter values may cause undesired behavior)")); + dialog::addItem(XLAT("configure WFC"), 'W'); dialog::add_action_push(wfc::wfc_menu);