Fixed: removing a thing should also remove it from the visible things list. (reported by DOOMGABR)

This commit is contained in:
ZZYZX 2017-03-13 03:26:50 +02:00
parent 36af342423
commit dceeed6bee

View file

@ -3139,7 +3139,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
PreAction(UndoGroup.None); PreAction(UndoGroup.None);
List<IVisualEventReceiver> objs = GetSelectedObjects(true, true, true, true); List<IVisualEventReceiver> 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(); PostAction();
ClearSelection(); ClearSelection();
@ -3178,7 +3183,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(IVisualEventReceiver i in objs) foreach(IVisualEventReceiver i in objs)
{ {
BaseVisualThing thing = (BaseVisualThing)i; BaseVisualThing thing = (BaseVisualThing)i;
thing.Thing.Fields.BeforeFieldsChange(); visiblethings.Remove(thing.Thing); // [ZZ] if any
thing.Thing.Fields.BeforeFieldsChange();
thing.Thing.Dispose(); thing.Thing.Dispose();
thing.Dispose(); thing.Dispose();
} }