Fix: Replace All items using a copy of the tile

The field array will get mutated, so make sure that our item reference isn't one of the field tiles.
This commit is contained in:
Kurt
2021-02-28 18:41:25 -08:00
parent 6ab6375ce6
commit 75c176c028

View File

@@ -389,7 +389,8 @@ private void ReplaceTile(Item tile, int x, int y)
}
bool wholeMap = (ModifierKeys & Keys.Shift) != 0;
var count = View.ReplaceFieldItems(tile, pgt, wholeMap);
var copy = new Item(tile.RawValue);
var count = View.ReplaceFieldItems(copy, pgt, wholeMap);
if (count == 0)
{
WinFormsUtil.Alert(MessageStrings.MsgFieldItemModifyNone);