Fix StrapComponent erroring when being removed with buckled entities

This commit is contained in:
DrSmugleaf
2020-10-14 00:19:30 +02:00
parent 844e4f6e50
commit e7fb849e22

View File

@@ -1,5 +1,6 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components.Buckle;
using Content.Shared.GameObjects.Components.Strap;
using Content.Shared.GameObjects.EntitySystems;
@@ -150,7 +151,7 @@ namespace Content.Server.GameObjects.Components.Strap
{
base.OnRemove();
foreach (var entity in _buckledEntities)
foreach (var entity in _buckledEntities.ToArray())
{
if (entity.TryGetComponent<BuckleComponent>(out var buckle))
{