From 6c1d1057d5d45e49e8d4262c495219b89c1bcf38 Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Sat, 13 Jul 2024 03:59:33 -0700 Subject: [PATCH] Replace DetachParentToNull() with DetachEntity() (#29992) DETACH PARENT TO ENTITY Co-authored-by: plykiya --- Content.Client/Materials/MaterialStorageSystem.cs | 4 ++-- Content.Client/Stack/StackSystem.cs | 2 +- Content.Shared/Actions/ActionContainerSystem.cs | 2 +- Content.Shared/Follower/FollowerSystem.cs | 2 +- .../Inventory/VirtualItem/SharedVirtualItemSystem.cs | 2 +- .../Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Content.Client/Materials/MaterialStorageSystem.cs b/Content.Client/Materials/MaterialStorageSystem.cs index edd07391f7..592471d673 100644 --- a/Content.Client/Materials/MaterialStorageSystem.cs +++ b/Content.Client/Materials/MaterialStorageSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Materials; +using Content.Shared.Materials; using Robust.Client.GameObjects; namespace Content.Client.Materials; @@ -49,7 +49,7 @@ public sealed class MaterialStorageSystem : SharedMaterialStorageSystem { if (!base.TryInsertMaterialEntity(user, toInsert, receiver, storage, material, composition)) return false; - _transform.DetachParentToNull(toInsert, Transform(toInsert)); + _transform.DetachEntity(toInsert, Transform(toInsert)); return true; } } diff --git a/Content.Client/Stack/StackSystem.cs b/Content.Client/Stack/StackSystem.cs index c081581338..7e681aeba3 100644 --- a/Content.Client/Stack/StackSystem.cs +++ b/Content.Client/Stack/StackSystem.cs @@ -44,7 +44,7 @@ namespace Content.Client.Stack // TODO PREDICT ENTITY DELETION: This should really just be a normal entity deletion call. if (component.Count <= 0 && !component.Lingering) { - Xform.DetachParentToNull(uid, Transform(uid)); + Xform.DetachEntity(uid, Transform(uid)); return; } diff --git a/Content.Shared/Actions/ActionContainerSystem.cs b/Content.Shared/Actions/ActionContainerSystem.cs index 1c5a3ba0d9..1a83cf38e5 100644 --- a/Content.Shared/Actions/ActionContainerSystem.cs +++ b/Content.Shared/Actions/ActionContainerSystem.cs @@ -261,7 +261,7 @@ public sealed class ActionContainerSystem : EntitySystem if (action.Container == null) return; - _transform.DetachParentToNull(actionId, Transform(actionId)); + _transform.DetachEntity(actionId, Transform(actionId)); // Container removal events should have removed the action from the action container. // However, just in case the container was already deleted we will still manually clear the container field diff --git a/Content.Shared/Follower/FollowerSystem.cs b/Content.Shared/Follower/FollowerSystem.cs index 8027ee449c..8c35617e2c 100644 --- a/Content.Shared/Follower/FollowerSystem.cs +++ b/Content.Shared/Follower/FollowerSystem.cs @@ -227,7 +227,7 @@ public sealed class FollowerSystem : EntitySystem if (_netMan.IsClient) { - _transform.DetachParentToNull(uid, xform); + _transform.DetachEntity(uid, xform); return; } diff --git a/Content.Shared/Inventory/VirtualItem/SharedVirtualItemSystem.cs b/Content.Shared/Inventory/VirtualItem/SharedVirtualItemSystem.cs index 4a5894d895..cd0863ec88 100644 --- a/Content.Shared/Inventory/VirtualItem/SharedVirtualItemSystem.cs +++ b/Content.Shared/Inventory/VirtualItem/SharedVirtualItemSystem.cs @@ -244,7 +244,7 @@ public abstract class SharedVirtualItemSystem : EntitySystem if (TerminatingOrDeleted(item)) return; - _transformSystem.DetachParentToNull(item, Transform(item)); + _transformSystem.DetachEntity(item, Transform(item)); if (_netManager.IsServer) QueueDel(item); } diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs index adae26a223..d6f45ba77d 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs @@ -108,7 +108,7 @@ public abstract partial class SharedGunSystem else { // Similar to below just due to prediction. - TransformSystem.DetachParentToNull(chamberEnt.Value, Transform(chamberEnt.Value)); + TransformSystem.DetachEntity(chamberEnt.Value, Transform(chamberEnt.Value)); } }