Content ecs containers (#22484)
This commit is contained in:
@@ -11,6 +11,7 @@ using Content.Shared.Mind.Components;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Storage.EntitySystems;
|
||||
using Content.Shared.Tools.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -20,6 +21,7 @@ public sealed class BluespaceLockerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly EntityStorageSystem _entityStorage = default!;
|
||||
[Dependency] private readonly WeldableSystem _weldableSystem = default!;
|
||||
[Dependency] private readonly LockSystem _lockSystem = default!;
|
||||
@@ -91,12 +93,12 @@ public sealed class BluespaceLockerSystem : EntitySystem
|
||||
if (!component.BehaviorProperties.TransportSentient)
|
||||
continue;
|
||||
|
||||
entityStorageComponent.Contents.Insert(entity, EntityManager);
|
||||
_containerSystem.Insert(entity, entityStorageComponent.Contents);
|
||||
transportedEntities++;
|
||||
}
|
||||
else if (component.BehaviorProperties.TransportEntities)
|
||||
{
|
||||
entityStorageComponent.Contents.Insert(entity, EntityManager);
|
||||
_containerSystem.Insert(entity, entityStorageComponent.Contents);
|
||||
transportedEntities++;
|
||||
}
|
||||
}
|
||||
@@ -308,12 +310,12 @@ public sealed class BluespaceLockerSystem : EntitySystem
|
||||
if (!component.BehaviorProperties.TransportSentient)
|
||||
continue;
|
||||
|
||||
target.Value.storageComponent.Contents.Insert(entity, EntityManager);
|
||||
_containerSystem.Insert(entity, target.Value.storageComponent.Contents);
|
||||
transportedEntities++;
|
||||
}
|
||||
else if (component.BehaviorProperties.TransportEntities)
|
||||
{
|
||||
target.Value.storageComponent.Contents.Insert(entity, EntityManager);
|
||||
_containerSystem.Insert(entity, target.Value.storageComponent.Contents);
|
||||
transportedEntities++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,14 @@ using Robust.Shared.Random;
|
||||
using System.Linq;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Server.Storage.EntitySystems;
|
||||
|
||||
public sealed class CursedEntityStorageSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly EntityStorageSystem _entityStorage = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
|
||||
@@ -48,7 +50,7 @@ public sealed class CursedEntityStorageSystem : EntitySystem
|
||||
|
||||
foreach (var entity in storage.Contents.ContainedEntities.ToArray())
|
||||
{
|
||||
storage.Contents.Remove(entity);
|
||||
_container.Remove(entity, storage.Contents);
|
||||
_entityStorage.AddToContents(entity, lockerEnt);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user