Fix collection modified error when locking storage (#27913)

This commit is contained in:
ShadowCommander 2024-05-11 02:25:40 -07:00 committed by null
parent 84dc0e5285
commit 1548f9b9ad
No known key found for this signature in database
GPG Key ID: 212F05528FD678BE
1 changed files with 2 additions and 2 deletions

View File

@ -1415,11 +1415,11 @@ public abstract class SharedStorageSystem : EntitySystem
return;
// Gets everyone looking at the UI
foreach (var actor in _ui.GetActors(uid, StorageComponent.StorageUiKey.Key))
foreach (var actor in _ui.GetActors(uid, StorageComponent.StorageUiKey.Key).ToList())
{
if (_admin.HasAdminFlag(actor, AdminFlags.Admin))
continue;
// And closes it unless they're an admin
_ui.CloseUi(uid, StorageComponent.StorageUiKey.Key, actor);
}