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:
slarticodefast
2024-08-04 07:38:53 +02:00
committed by GitHub
parent 206495fd6d
commit bb2981400c
24 changed files with 40 additions and 40 deletions

View 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);
}

View 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))

View 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))
{

View 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;

View 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

View 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))
{

View 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)

View 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())
{