Visual Mode: fixed an issue where deleting a thing could cause a crash. Fixes #730

This commit is contained in:
biwa 2022-05-07 18:49:36 +02:00
parent 44a2a0daae
commit ccdbc28ed8

View file

@ -3850,8 +3850,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
List<IVisualEventReceiver> 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();