]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
replace all uses of TryGetContainingContainer with non-obsolete overload (#30583)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sun, 4 Aug 2024 05:38:53 +0000 (07:38 +0200)
committerGitHub <noreply@github.com>
Sun, 4 Aug 2024 05:38:53 +0000 (15:38 +1000)
* replace all uses of TryGetContainerContainer with non-obsolete overload

* rerun

24 files changed:
Content.Client/Commands/HideMechanismsCommand.cs
Content.Client/Instruments/UI/InstrumentMenu.xaml.cs
Content.Client/Items/Systems/ItemSystem.cs
Content.Client/Movement/Systems/JetpackSystem.cs
Content.Server/Atmos/Rotting/RottingSystem.cs
Content.Server/Cargo/Systems/CargoSystem.Bounty.cs
Content.Server/Nutrition/EntitySystems/SmokingSystem.cs
Content.Server/PDA/PdaSystem.cs
Content.Server/Polymorph/Systems/PolymorphSystem.cs
Content.Server/PowerCell/PowerCellSystem.cs
Content.Server/Resist/EscapeInventorySystem.cs
Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs
Content.Shared/Body/Systems/SharedBodySystem.Organs.cs
Content.Shared/Body/Systems/SharedBodySystem.Parts.cs
Content.Shared/Clothing/ClothingSpeedModifierSystem.cs
Content.Shared/Clothing/EntitySystems/ClothingSystem.cs
Content.Shared/Clothing/MagbootsSystem.cs
Content.Shared/Damage/Systems/DamageOnHoldingSystem.cs
Content.Shared/Interaction/SharedInteractionSystem.cs
Content.Shared/Item/SharedItemSystem.cs
Content.Shared/Materials/SharedMaterialReclaimerSystem.cs
Content.Shared/Movement/Systems/SharedJetpackSystem.cs
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Clothing.cs

index 5f9afc78b982348133e2ba79695972bd1cf7826c..97d792628a62089de37610f9da44867b4858ed66 100644 (file)
@@ -30,7 +30,7 @@ public sealed class HideMechanismsCommand : LocalizedCommands
             sprite.ContainerOccluded = false;
 
             var tempParent = uid;
-            while (containerSys.TryGetContainingContainer(tempParent, out var container))
+            while (containerSys.TryGetContainingContainer((tempParent, null, null), out var container))
             {
                 if (!container.ShowContents)
                 {
index fc863648d798feed88265609578b6220a50ec2bc..9b14e01fb57ffa730c8c0d68eafc1c356d781c9c 100644 (file)
@@ -206,7 +206,7 @@ namespace Content.Client.Instruments.UI
 
             var container = _entManager.System<SharedContainerSystem>();
             // If we're a handheld instrument, we might be in a container. Get it just in case.
-            container.TryGetContainingContainer(Entity, out var conMan);
+            container.TryGetContainingContainer((Entity, null, null), out var conMan);
 
             // If the instrument is handheld and we're not holding it, we return.
             if (instrument.Handheld && (conMan == null || conMan.Owner != localEntity))
index 5e60d06d0ce1ded1c9beca86439aed7b91d2635c..2b5a41c6ce7ee3daf84520e4f4b8a811f4b11a75 100644 (file)
@@ -43,7 +43,7 @@ public sealed class ItemSystem : SharedItemSystem
     public override void VisualsChanged(EntityUid uid)
     {
         // if the item is in a container, it might be equipped to hands or inventory slots --> update visuals.
-        if (Container.TryGetContainingContainer(uid, out var container))
+        if (Container.TryGetContainingContainer((uid, null, null), out var container))
             RaiseLocalEvent(container.Owner, new VisualsChangedEvent(GetNetEntity(uid), container.ID));
     }
 
index e25300d44c500d16fad46fa61611e18ff019c2c0..2954140d7927b00639fdacdbdb7dae6c3f0a026b 100644 (file)
@@ -64,15 +64,15 @@ public sealed class JetpackSystem : SharedJetpackSystem
 
     private void CreateParticles(EntityUid uid)
     {
+        var uidXform = Transform(uid);
         // Don't show particles unless the user is moving.
-        if (Container.TryGetContainingContainer(uid, out var container) &&
+        if (Container.TryGetContainingContainer((uid, uidXform, null), out var container) &&
             TryComp<PhysicsComponent>(container.Owner, out var body) &&
             body.LinearVelocity.LengthSquared() < 1f)
         {
             return;
         }
 
-        var uidXform = Transform(uid);
         var coordinates = uidXform.Coordinates;
         var gridUid = _transform.GetGrid(coordinates);
 
index 5070b3f197f0fb577609792a281f9015f1ee078e..43dddce4a4e5c64ffae79fb725b3dccc3bf1e2ee 100644 (file)
@@ -34,7 +34,7 @@ public sealed class RottingSystem : SharedRottingSystem
         if (!TryComp<PerishableComponent>(uid, out var perishable))
             return;
 
-        var molsToDump = perishable.MolsPerSecondPerUnitMass * physics.FixturesMass * (float) component.TotalRotTime.TotalSeconds;
+        var molsToDump = perishable.MolsPerSecondPerUnitMass * physics.FixturesMass * (float)component.TotalRotTime.TotalSeconds;
         var tileMix = _atmosphere.GetTileMixture(uid, excite: true);
         tileMix?.AdjustMoles(Gas.Ammonia, molsToDump);
     }
@@ -54,7 +54,7 @@ public sealed class RottingSystem : SharedRottingSystem
     /// <returns></returns>
     private float GetRotRate(EntityUid uid)
     {
-        if (_container.TryGetContainingContainer(uid, out var container) &&
+        if (_container.TryGetContainingContainer((uid, null, null), out var container) &&
             TryComp<ProRottingContainerComponent>(container.Owner, out var rotContainer))
         {
             return rotContainer.DecayModifier;
@@ -124,7 +124,7 @@ public sealed class RottingSystem : SharedRottingSystem
                 continue;
             // We need a way to get the mass of the mob alone without armor etc in the future
             // or just remove the mass mechanics altogether because they aren't good.
-            var molRate = perishable.MolsPerSecondPerUnitMass * (float) rotting.RotUpdateRate.TotalSeconds;
+            var molRate = perishable.MolsPerSecondPerUnitMass * (float)rotting.RotUpdateRate.TotalSeconds;
             var tileMix = _atmosphere.GetTileMixture(uid, excite: true);
             tileMix?.AdjustMoles(Gas.Ammonia, molRate * physics.FixturesMass);
         }
index 4cbf2e63be8f9c1ddbfc87338c98d7941840a149..89c4635b0c8d265980d53cc6c85b63119e732820 100644 (file)
@@ -138,7 +138,7 @@ public sealed partial class CargoSystem
             return;
 
         // make sure this label was actually applied to a crate.
-        if (!_container.TryGetContainingContainer(uid, out var container) || container.ID != LabelSystem.ContainerName)
+        if (!_container.TryGetContainingContainer((uid, null, null), out var container) || container.ID != LabelSystem.ContainerName)
             return;
 
         if (component.AssociatedStationId is not { } station || !TryComp<StationCargoBountyDatabaseComponent>(station, out var database))
index a33c944c99482e690e4696908c69155723fcdf2f..7f8253efedf682ac3a01fdef56c393a2420d4d71 100644 (file)
@@ -142,7 +142,7 @@ namespace Content.Server.Nutrition.EntitySystems
 
                 // This is awful. I hate this so much.
                 // TODO: Please, someone refactor containers and free me from this bullshit.
-                if (!_container.TryGetContainingContainer(uid, out var containerManager) ||
+                if (!_container.TryGetContainingContainer((uid, null, null), out var containerManager) ||
                     !(_inventorySystem.TryGetSlotEntity(containerManager.Owner, "mask", out var inMaskSlotUid) && inMaskSlotUid == uid) ||
                     !TryComp(containerManager.Owner, out BloodstreamComponent? bloodstream))
                 {
index 43bf571eb45665519203d0c454081f2faa0cc572..691d024ecd74ffa5e5aec476b8ecc92e993401a2 100644 (file)
@@ -123,7 +123,7 @@ namespace Content.Server.PDA
         {
             _ringer.RingerPlayRingtone(ent.Owner);
 
-            if (!_containerSystem.TryGetContainingContainer(ent, out var container)
+            if (!_containerSystem.TryGetContainingContainer((ent, null, null), out var container)
                 || !TryComp<ActorComponent>(container.Owner, out var actor))
                 return;
 
index d4a9159d44ff6cb949a52b8b15edbc5222561b5e..daff200982dcc8b0fef008df89b1e4f3b657e27a 100644 (file)
@@ -211,7 +211,7 @@ public sealed partial class PolymorphSystem : EntitySystem
         var childXform = Transform(child);
         _transform.SetLocalRotation(child, targetTransformComp.LocalRotation, childXform);
 
-        if (_container.TryGetContainingContainer(uid, out var cont))
+        if (_container.TryGetContainingContainer((uid, targetTransformComp, null), out var cont))
             _container.Insert(child, cont);
 
         //Transfers all damage from the original to the new one
index 0d2d9012bc79f99b2b09c2012ce7dc44ad5d0f1a..f7b4cf024917e805d92ae5f98a009b6c825b1df3 100644 (file)
@@ -64,11 +64,11 @@ public sealed partial class PowerCellSystem : SharedPowerCellSystem
         }
 
         var frac = args.Charge / args.MaxCharge;
-        var level = (byte) ContentHelpers.RoundToNearestLevels(frac, 1, PowerCellComponent.PowerCellVisualsLevels);
+        var level = (byte)ContentHelpers.RoundToNearestLevels(frac, 1, PowerCellComponent.PowerCellVisualsLevels);
         _sharedAppearanceSystem.SetData(uid, PowerCellVisuals.ChargeLevel, level);
 
         // If this power cell is inside a cell-slot, inform that entity that the power has changed (for updating visuals n such).
-        if (_containerSystem.TryGetContainingContainer(uid, out var container)
+        if (_containerSystem.TryGetContainingContainer((uid, null, null), out var container)
             && TryComp(container.Owner, out PowerCellSlotComponent? slot)
             && _itemSlotsSystem.TryGetSlot(container.Owner, slot.CellSlotId, out var itemSlot))
         {
index 35c7d0bc65b0bfadaa091963299edb265c6b5fbd..041257d78d7515f5972848db02414252b0037564 100644 (file)
@@ -34,7 +34,7 @@ public sealed class EscapeInventorySystem : EntitySystem
         if (!args.HasDirectionalMovement)
             return;
 
-        if (!_containerSystem.TryGetContainingContainer(uid, out var container) || !_actionBlockerSystem.CanInteract(uid, container.Owner))
+        if (!_containerSystem.TryGetContainingContainer((uid, null, null), out var container) || !_actionBlockerSystem.CanInteract(uid, container.Owner))
             return;
 
         // Make sure there's nothing stopped the removal (like being glued)
index e6c627f353e2bb831f86179db5171239d5fadd44..6e3d9e925166ce860c43cb6746087a1ba98c1e8e 100644 (file)
@@ -95,7 +95,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
             return;
 
         // Handle singularities some admin smited into a locker.
-        if (_containerSystem.TryGetContainingContainer(uid, out var container, transform: xform)
+        if (_containerSystem.TryGetContainingContainer((uid, xform, null), out var container)
         && !AttemptConsumeEntity(uid, container.Owner, eventHorizon))
         {
             // Locker is indestructible. Consume everything else in the locker instead of magically teleporting out.
@@ -214,7 +214,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
                 if (_containerSystem.Insert(entity, target_container))
                     break;
 
-                _containerSystem.TryGetContainingContainer(target_container.Owner, out target_container);
+                _containerSystem.TryGetContainingContainer((target_container.Owner, null, null), out target_container);
             }
 
             // If we couldn't or there was no container to insert into just dump them to the map/grid.
@@ -470,7 +470,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
     {
         var drop_container = args.Container;
         if (drop_container is null)
-            _containerSystem.TryGetContainingContainer(uid, out drop_container);
+            _containerSystem.TryGetContainingContainer((uid, null, null), out drop_container);
 
         foreach (var container in comp.GetAllContainers())
         {
index 1c315869c857ea2481e400c10a908c58a3d70895..f83dd50c99878f80b1beeaa0a91148ea450a69d5 100644 (file)
@@ -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;
index ee79faa0b8e7ab31e349f73c8f764c5a288f4efc..0917197e29f19afc22800d8cfb2b85792d8fc759 100644 (file)
@@ -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;
index 897f3791561c8ebec2b9aebf3f82f63cae5a2470..21afd4e591dc34b59a025253ae04bf48d0cef35a 100644 (file)
@@ -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);
index 14137b383655806440ce244a4984a51ef371c696..082b040a32051ec00257c92ca760a3164e8ca072 100644 (file)
@@ -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);
             }
index 88d987aae181be264ff0b31332603a1b9e0b0341..d41f27fefb07f3b382becdd5aa3494cd882ee415 100644 (file)
@@ -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)
         {
index c13ec0a1b9f6d35f364f5dba84c4aaeedca192d6..78e86f5ab42364241936ce9c09ab0489871d6047 100644 (file)
@@ -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);
             }
index a57796d87c4586eb7bc466c86a005b5fcfdabdcb..972fa389e4060edb7cd9f079c7c8a8efced4aa9e 100644 (file)
@@ -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;
index 5eaa25f4847535602300f29e6371e4627ca93aaf..a058cb865884055641c3bfeb926a95ad41239c4a 100644 (file)
@@ -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");
index 9a7da17d486353e9518569027923cfdae03ff8b6..866148b113161d4bc71b7870388a54d29f530882 100644 (file)
@@ -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)
index 724eca682fbe7f4e253417f12a2ccb89717691d3..276aa620324e27c02ed896ccc9d5f10e25870970 100644 (file)
@@ -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;
         }
 
index 7a207fb47cfb8186977518347ba0fb1c7c98598e..cac3b86ad6091e3f76cb4174ce1748f321b710be 100644 (file)
@@ -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);
index d4aa024f4c84d909b33cbb9eb490ea9c47a3f5d5..7ef57df53919c542bf0dfcef241b60321e4bd554 100644 (file)
@@ -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;