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

@@ -91,7 +91,7 @@ public sealed partial class EnsnareableSystem
}
component.Ensnared = target;
ensnareable.Container.Insert(ensnare);
_container.Insert(ensnare, ensnareable.Container);
ensnareable.IsEnsnared = true;
Dirty(ensnareable);
@@ -147,7 +147,7 @@ public sealed partial class EnsnareableSystem
var target = component.Ensnared.Value;
ensnareable.Container.Remove(ensnare, force: true);
_container.Remove(ensnare, ensnareable.Container, force: true);
ensnareable.IsEnsnared = ensnareable.Container.ContainedEntities.Count > 0;
Dirty(ensnareable);
component.Ensnared = null;

View File

@@ -38,7 +38,7 @@ public sealed partial class EnsnareableSystem : SharedEnsnareableSystem
if (args.Handled || !TryComp<EnsnaringComponent>(args.Args.Used, out var ensnaring))
return;
if (args.Cancelled || !component.Container.Remove(args.Args.Used.Value))
if (args.Cancelled || !_container.Remove(args.Args.Used.Value, component.Container))
{
_popup.PopupEntity(Loc.GetString("ensnare-component-try-free-fail", ("ensnare", args.Args.Used)), uid, uid, PopupType.MediumCaution);
return;