Content ecs containers (#22484)

This commit is contained in:
TemporalOroboros
2023-12-27 21:30:03 -08:00
committed by GitHub
parent 1d06539432
commit 7a77d6d5dd
72 changed files with 172 additions and 160 deletions

View File

@@ -173,7 +173,7 @@ public sealed class StickySystem : EntitySystem
// add container to entity and insert sticker into it
var container = _containerSystem.EnsureContainer<Container>(target, StickerSlotId);
container.ShowContents = true;
if (!container.Insert(uid))
if (!_containerSystem.Insert(uid, container))
return;
// show message to user
@@ -207,11 +207,11 @@ public sealed class StickySystem : EntitySystem
return;
// try to remove sticky item from target container
if (!_containerSystem.TryGetContainer(stuckTo, StickerSlotId, out var container) || !container.Remove(uid))
if (!_containerSystem.TryGetContainer(stuckTo, StickerSlotId, out var container) || !_containerSystem.Remove(uid, container))
return;
// delete container if it's now empty
if (container.ContainedEntities.Count == 0)
container.Shutdown();
_containerSystem.ShutdownContainer(container);
// try place dropped entity into user hands
_handsSystem.PickupOrDrop(user, uid);