From ccdbc28ed80d0df00c599c7b387c34a14a5ac23b Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Sat, 7 May 2022 18:49:36 +0200 Subject: [PATCH] Visual Mode: fixed an issue where deleting a thing could cause a crash. Fixes #730 --- Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 60e2c152..82528886 100755 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -3850,8 +3850,11 @@ namespace CodeImp.DoomBuilder.BuilderModes List objs = GetSelectedObjects(true, true, true, true, false); foreach (IVisualEventReceiver i in objs) { - if (i is BaseVisualThing) - visiblethings.Remove((BaseVisualThing)i); // [ZZ] if any + if (i is BaseVisualThing) + { + visiblethings.Remove((BaseVisualThing)i); // [ZZ] if any + allthings.Remove(((BaseVisualThing)i).Thing); + } i.OnDelete(); } PostAction();