mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 06:42:25 +02:00
Updated ContainerHelpers to use new extensions (#1396)
Co-authored-by: David Tan <>
This commit is contained in:
@@ -61,7 +61,7 @@ namespace Robust.Client.GameObjects.EntitySystems
|
||||
|
||||
// We have to recursively scan for containers upwards in case of nested containers.
|
||||
var tempParent = entity;
|
||||
while (ContainerHelpers.TryGetContainer(tempParent, out var container))
|
||||
while (tempParent.TryGetContainer(out var container))
|
||||
{
|
||||
if (!container.ShowContents)
|
||||
{
|
||||
@@ -79,7 +79,7 @@ namespace Robust.Client.GameObjects.EntitySystems
|
||||
|
||||
// We have to recursively scan for containers upwards in case of nested containers.
|
||||
var tempParent = entity;
|
||||
while (ContainerHelpers.TryGetContainer(tempParent, out var container))
|
||||
while (tempParent.TryGetContainer(out var container))
|
||||
{
|
||||
if (container.OccludesLight)
|
||||
{
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace Robust.Server.GameObjects.Components.Container
|
||||
if (transform.Parent == null) // Only true if Parent is the map entity
|
||||
return false;
|
||||
|
||||
if(ContainerHelpers.TryGetContainerMan(transform.Parent.Owner, out var containerManager) && !containerManager.Remove(toinsert))
|
||||
if(transform.Parent.Owner.TryGetContainerMan(out var containerManager) && !containerManager.Remove(toinsert))
|
||||
{
|
||||
// Can't remove from existing container, can't insert.
|
||||
return false;
|
||||
@@ -182,7 +182,7 @@ namespace Robust.Server.GameObjects.Components.Container
|
||||
if (!toremove.IsValid())
|
||||
return true;
|
||||
|
||||
ContainerHelpers.AttachParentToContainerOrGrid(toremove.Transform);
|
||||
toremove.Transform.AttachParentToContainerOrGrid();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace Robust.Shared.GameObjects.Components.Transform
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsMapTransform => !ContainerHelpers.IsInContainer(Owner);
|
||||
public bool IsMapTransform => !Owner.IsInContainer();
|
||||
|
||||
/// <inheritdoc />
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -372,7 +372,7 @@ namespace Robust.Shared.GameObjects.Systems
|
||||
|
||||
if (physics.LinearVelocity != Vector2.Zero)
|
||||
{
|
||||
if (ContainerHelpers.IsInContainer(ent))
|
||||
if (ent.IsInContainer())
|
||||
{
|
||||
var relayEntityMoveMessage = new RelayMovementEntityMessage(ent);
|
||||
ent.Transform.Parent!.Owner.SendMessage(ent.Transform, relayEntityMoveMessage);
|
||||
@@ -393,7 +393,7 @@ namespace Robust.Shared.GameObjects.Systems
|
||||
var transform = owner.Transform;
|
||||
|
||||
// Change parent if necessary
|
||||
if (!ContainerHelpers.IsInContainer(owner))
|
||||
if (!owner.IsInContainer())
|
||||
{
|
||||
// This shoouullddnnn'''tt de-parent anything in a container because none of that should have physics applied to it.
|
||||
if (_mapManager.TryFindGridAt(owner.Transform.MapID, newPosition, out var grid) &&
|
||||
|
||||
Reference in New Issue
Block a user