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)
{
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))
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));
}
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);
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);
}
/// <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;
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);
}
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))
// 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))
{
{
_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;
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
}
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))
{
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)
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.
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.
{
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())
{
/// </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;
/// </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;
/// </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);
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;
// 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);
}
// 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);
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);
}
{
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)
{
{
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);
}
/// </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);
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;
// 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");
_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)
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()
if (user == null)
{
- Container.TryGetContainingContainer(uid, out var container);
+ Container.TryGetContainingContainer((uid, null, null), out var container);
user = container?.Owner;
}
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);
{
slotEntity = null;
- if (!Containers.TryGetContainingContainer(uid, out var container))
+ if (!Containers.TryGetContainingContainer((uid, null, null), out var container))
return false;
var user = container.Owner;