From 2eb454ae0718bf98d8a30cd4f8427d8ab2fa263b Mon Sep 17 00:00:00 2001 From: ZZYZX Date: Mon, 13 Mar 2017 03:26:50 +0200 Subject: [PATCH] Fixed: removing a thing should also remove it from the visible things list. (reported by DOOMGABR) --- .../Plugins/BuilderModes/VisualModes/BaseVisualMode.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 1eb076c..b7450d9 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -3382,7 +3382,12 @@ namespace CodeImp.DoomBuilder.BuilderModes { PreAction(UndoGroup.None); List objs = GetSelectedObjects(true, true, true, true); - foreach(IVisualEventReceiver i in objs) i.OnDelete(); + foreach (IVisualEventReceiver i in objs) + { + if (i is BaseVisualThing) + visiblethings.Remove(((BaseVisualThing)i).Thing); // [ZZ] if any + i.OnDelete(); + } PostAction(); ClearSelection(); @@ -3421,7 +3426,8 @@ namespace CodeImp.DoomBuilder.BuilderModes foreach(IVisualEventReceiver i in objs) { BaseVisualThing thing = (BaseVisualThing)i; - thing.Thing.Fields.BeforeFieldsChange(); + visiblethings.Remove(thing.Thing); // [ZZ] if any + thing.Thing.Fields.BeforeFieldsChange(); thing.Thing.Dispose(); thing.Dispose(); }