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
1 changed files with 8 additions and 4 deletions

View File

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