Content ecs containers (#22484)
This commit is contained in:
@@ -54,7 +54,7 @@ public sealed partial class BuildMech : IGraphAction
|
||||
return;
|
||||
}
|
||||
|
||||
container.Remove(cell);
|
||||
containerSystem.Remove(cell, container);
|
||||
|
||||
var transform = entityManager.GetComponent<TransformComponent>(uid);
|
||||
var mech = entityManager.SpawnEntity(MechPrototype, transform.Coordinates);
|
||||
@@ -62,7 +62,7 @@ public sealed partial class BuildMech : IGraphAction
|
||||
if (entityManager.TryGetComponent<MechComponent>(mech, out var mechComp) && mechComp.BatterySlot.ContainedEntity == null)
|
||||
{
|
||||
mechSys.InsertBattery(mech, cell, mechComp, batteryComponent);
|
||||
mechComp.BatterySlot.Insert(cell);
|
||||
containerSystem.Insert(cell, mechComp.BatterySlot);
|
||||
}
|
||||
|
||||
var entChangeEv = new ConstructionChangeEntityEvent(mech, uid);
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.Construction.Completions
|
||||
|
||||
foreach (var contained in container.ContainedEntities.ToArray())
|
||||
{
|
||||
if(container.Remove(contained))
|
||||
if(containerSys.Remove(contained, container))
|
||||
entityManager.QueueDeleteEntity(contained);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace Content.Server.Construction.Completions
|
||||
|
||||
foreach (var contained in from.ContainedEntities.ToArray())
|
||||
{
|
||||
if (from.Remove(contained))
|
||||
to.Insert(contained);
|
||||
if (containerSystem.Remove(contained, from))
|
||||
containerSystem.Insert(contained, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.Construction.Completions
|
||||
var coordinates = entityManager.GetComponent<TransformComponent>(uid).Coordinates;
|
||||
for (var i = 0; i < Amount; i++)
|
||||
{
|
||||
container.Insert(entityManager.SpawnEntity(Prototype, coordinates));
|
||||
containerSystem.Insert(entityManager.SpawnEntity(Prototype, coordinates), container);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user