Fix ChangeEntity collection modified exception.
This commit is contained in:
@@ -206,8 +206,9 @@ namespace Content.Server.Construction
|
|||||||
// NOTE: Only Container is supported by Construction!
|
// NOTE: Only Container is supported by Construction!
|
||||||
var otherContainer = _containerSystem.EnsureContainer<Container>(newUid, container, newContainerManager);
|
var otherContainer = _containerSystem.EnsureContainer<Container>(newUid, container, newContainerManager);
|
||||||
|
|
||||||
foreach (var entity in ourContainer.ContainedEntities)
|
for (var i = ourContainer.ContainedEntities.Count - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
|
var entity = ourContainer.ContainedEntities[i];
|
||||||
ourContainer.ForceRemove(entity);
|
ourContainer.ForceRemove(entity);
|
||||||
otherContainer.Insert(entity);
|
otherContainer.Insert(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
4
Resources/Changelog/Parts/duple.yml
Normal file
4
Resources/Changelog/Parts/duple.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Zumorica
|
||||||
|
changes:
|
||||||
|
- type: Fix # One of the following: Add, Remove, Tweak, Fix
|
||||||
|
message: Fix computer dupe bug.
|
||||||
Reference in New Issue
Block a user