replace all uses of TryGetContainingContainer with non-obsolete overload (#30583)
* replace all uses of TryGetContainerContainer with non-obsolete overload * rerun
This commit is contained in:
@@ -124,7 +124,7 @@ public partial class SharedBodySystem
|
||||
/// </summary>
|
||||
public bool RemoveOrgan(EntityUid organId, OrganComponent? organ = null)
|
||||
{
|
||||
if (!Containers.TryGetContainingContainer(organId, out var container))
|
||||
if (!Containers.TryGetContainingContainer((organId, null, null), out var container))
|
||||
return false;
|
||||
|
||||
var parent = container.Owner;
|
||||
|
||||
@@ -189,7 +189,7 @@ public partial class SharedBodySystem
|
||||
/// </summary>
|
||||
public EntityUid? GetParentPartOrNull(EntityUid uid)
|
||||
{
|
||||
if (!Containers.TryGetContainingContainer(uid, out var container))
|
||||
if (!Containers.TryGetContainingContainer((uid, null, null), out var container))
|
||||
return null;
|
||||
|
||||
var parent = container.Owner;
|
||||
@@ -205,7 +205,7 @@ public partial class SharedBodySystem
|
||||
/// </summary>
|
||||
public (EntityUid Parent, string Slot)? GetParentPartAndSlotOrNull(EntityUid uid)
|
||||
{
|
||||
if (!Containers.TryGetContainingContainer(uid, out var container))
|
||||
if (!Containers.TryGetContainingContainer((uid, null, null), out var container))
|
||||
return null;
|
||||
|
||||
var slotId = GetPartSlotContainerIdFromContainer(container.ID);
|
||||
@@ -235,7 +235,7 @@ public partial class SharedBodySystem
|
||||
parentUid = null;
|
||||
parentComponent = null;
|
||||
|
||||
if (Containers.TryGetContainingContainer(partUid, out var container) &&
|
||||
if (Containers.TryGetContainingContainer((partUid, null, null), out var container) &&
|
||||
TryComp(container.Owner, out parentComponent))
|
||||
{
|
||||
parentUid = container.Owner;
|
||||
|
||||
@@ -48,7 +48,7 @@ public sealed class ClothingSpeedModifierSystem : EntitySystem
|
||||
|
||||
// Avoid raising the event for the container if nothing changed.
|
||||
// We'll still set the values in case they're slightly different but within tolerance.
|
||||
if (diff && _container.TryGetContainingContainer(uid, out var container))
|
||||
if (diff && _container.TryGetContainingContainer((uid, null, null), out var container))
|
||||
{
|
||||
_movementSpeed.RefreshMovementSpeedModifiers(container.Owner);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public sealed class ClothingSpeedModifierSystem : EntitySystem
|
||||
// make sentient boots slow or fast too
|
||||
_movementSpeed.RefreshMovementSpeedModifiers(ent);
|
||||
|
||||
if (_container.TryGetContainingContainer(ent.Owner, out var container))
|
||||
if (_container.TryGetContainingContainer((ent.Owner, null, null), out var container))
|
||||
{
|
||||
// inventory system will automatically hook into the event raised by this and update accordingly
|
||||
_movementSpeed.RefreshMovementSpeedModifiers(container.Owner);
|
||||
|
||||
@@ -162,7 +162,7 @@ public abstract class ClothingSystem : EntitySystem
|
||||
if (args.Current is ClothingComponentState state)
|
||||
{
|
||||
SetEquippedPrefix(uid, state.EquippedPrefix, component);
|
||||
if (component.InSlot != null && _containerSys.TryGetContainingContainer(uid, out var container))
|
||||
if (component.InSlot != null && _containerSys.TryGetContainingContainer((uid, null, null), out var container))
|
||||
{
|
||||
CheckEquipmentForLayerHide(uid, container.Owner);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public sealed class SharedMagbootsSystem : EntitySystem
|
||||
{
|
||||
var (uid, comp) = ent;
|
||||
// only stick to the floor if being worn in the correct slot
|
||||
if (_container.TryGetContainingContainer(uid, out var container) &&
|
||||
if (_container.TryGetContainingContainer((uid, null, null), out var container) &&
|
||||
_inventory.TryGetSlotEntity(container.Owner, comp.Slot, out var worn)
|
||||
&& uid == worn)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ public sealed class DamageOnHoldingSystem : EntitySystem
|
||||
{
|
||||
if (!component.Enabled || component.NextDamage > _timing.CurTime)
|
||||
continue;
|
||||
if (_container.TryGetContainingContainer(uid, out var container))
|
||||
if (_container.TryGetContainingContainer((uid, null, null), out var container))
|
||||
{
|
||||
_damageableSystem.TryChangeDamage(container.Owner, component.Damage, origin: uid);
|
||||
}
|
||||
|
||||
@@ -1171,7 +1171,7 @@ namespace Content.Shared.Interaction
|
||||
/// </summary>
|
||||
public bool CanAccessViaStorage(EntityUid user, EntityUid target)
|
||||
{
|
||||
if (!_containerSystem.TryGetContainingContainer(target, out var container))
|
||||
if (!_containerSystem.TryGetContainingContainer((target, null, null), out var container))
|
||||
return false;
|
||||
|
||||
return CanAccessViaStorage(user, target, container);
|
||||
@@ -1197,7 +1197,7 @@ namespace Content.Shared.Interaction
|
||||
if (Deleted(target))
|
||||
return false;
|
||||
|
||||
if (!_containerSystem.TryGetContainingContainer(target, out var container))
|
||||
if (!_containerSystem.TryGetContainingContainer((target, null, null), out var container))
|
||||
return false;
|
||||
|
||||
var wearer = container.Owner;
|
||||
|
||||
@@ -110,8 +110,8 @@ public abstract class SharedItemSystem : EntitySystem
|
||||
|
||||
// if the item already in a container (that is not the same as the user's), then change the text.
|
||||
// this occurs when the item is in their inventory or in an open backpack
|
||||
Container.TryGetContainingContainer(args.User, out var userContainer);
|
||||
if (Container.TryGetContainingContainer(args.Target, out var container) && container != userContainer)
|
||||
Container.TryGetContainingContainer((args.User, null, null), out var userContainer);
|
||||
if (Container.TryGetContainingContainer((args.Target, null, null), out var container) && container != userContainer)
|
||||
verb.Text = Loc.GetString("pick-up-verb-get-data-text-inventory");
|
||||
else
|
||||
verb.Text = Loc.GetString("pick-up-verb-get-data-text");
|
||||
|
||||
@@ -97,7 +97,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
_whitelistSystem.IsBlacklistPass(component.Blacklist, item))
|
||||
return false;
|
||||
|
||||
if (Container.TryGetContainingContainer(item, out _) && !Container.TryRemoveFromContainer(item))
|
||||
if (Container.TryGetContainingContainer((item, null, null), out _) && !Container.TryRemoveFromContainer(item))
|
||||
return false;
|
||||
|
||||
if (user != null)
|
||||
|
||||
@@ -13,12 +13,12 @@ namespace Content.Shared.Movement.Systems;
|
||||
|
||||
public abstract class SharedJetpackSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
|
||||
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
|
||||
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
|
||||
[Dependency] protected readonly SharedContainerSystem Container = default!;
|
||||
[Dependency] private readonly SharedMoverController _mover = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly SharedMoverController _mover = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -158,7 +158,7 @@ public abstract class SharedJetpackSystem : EntitySystem
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
Container.TryGetContainingContainer(uid, out var container);
|
||||
Container.TryGetContainingContainer((uid, null, null), out var container);
|
||||
user = container?.Owner;
|
||||
}
|
||||
|
||||
|
||||
@@ -1431,7 +1431,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
||||
|
||||
private void OnStackCountChanged(EntityUid uid, MetaDataComponent component, StackCountChangedEvent args)
|
||||
{
|
||||
if (_containerSystem.TryGetContainingContainer(uid, out var container, component) &&
|
||||
if (_containerSystem.TryGetContainingContainer((uid, null, component), out var container) &&
|
||||
container.ID == StorageComponent.ContainerId)
|
||||
{
|
||||
UpdateAppearance(container.Owner);
|
||||
|
||||
@@ -33,7 +33,7 @@ public partial class SharedGunSystem
|
||||
{
|
||||
slotEntity = null;
|
||||
|
||||
if (!Containers.TryGetContainingContainer(uid, out var container))
|
||||
if (!Containers.TryGetContainingContainer((uid, null, null), out var container))
|
||||
return false;
|
||||
var user = container.Owner;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user