Fixed collection modification inside foreach. (reported by Lud)

This commit is contained in:
ZZYZX 2018-01-22 13:20:12 +02:00 committed by spherallic
parent 2953dc8715
commit 1b552471e0

View file

@ -804,10 +804,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
//Remove all vertex handles from selection //Remove all vertex handles from selection
if(vertices != null && vertices.Count > 0) if(vertices != null && vertices.Count > 0)
{ {
foreach(IVisualEventReceiver i in selectedobjects) for (int i = 0; i < selectedobjects.Count; i++)
{ {
if(i is BaseVisualVertex) RemoveSelectedObject(i); if (selectedobjects[i] is BaseVisualVertex)
} {
RemoveSelectedObject(selectedobjects[i]);
i--;
}
}
} }
} }