From 1ca917d91125d07cbc2622aabb5b820793d2c8d5 Mon Sep 17 00:00:00 2001 From: ReeZer2 <63300653+ReeZer2@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:18:28 +0200 Subject: [PATCH] FIX: Deleted entity delete buckled entity (#2433) --- .../Administration/Systems/AdminVerbSystem.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.cs b/Content.Server/Administration/Systems/AdminVerbSystem.cs index ca786d50bd4c..c489a0b87741 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.cs @@ -35,6 +35,8 @@ using Robust.Shared.Utility; using System.Linq; using Content.Server.Silicons.Laws; +using Content.Shared.Buckle; +using Content.Shared.Buckle.Components; using Content.Shared.Movement.Components; using Content.Shared.Silicons.Laws.Components; using Robust.Server.Player; @@ -73,6 +75,8 @@ public sealed partial class AdminVerbSystem : EntitySystem [Dependency] private readonly AdminFrozenSystem _freeze = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly SiliconLawSystem _siliconLawSystem = default!; + [Dependency] private readonly SharedBuckleSystem _buckle = default!; + private readonly Dictionary> _openSolutionUis = new(); @@ -447,7 +451,20 @@ private void AddDebugVerbs(GetVerbsEvent args) Text = Loc.GetString("delete-verb-get-data-text"), Category = VerbCategory.Debug, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png")), - Act = () => EntityManager.DeleteEntity(args.Target), + //ss220 delete buckled entity with target fix start (issue: #2409) + Act = () => + { + if (TryComp(args.Target, out var strap)) + { + foreach (var entity in strap.BuckledEntities) + { + _buckle.Unbuckle(entity, entity); + } + } + + EntityManager.DeleteEntity(args.Target); + }, + //ss220 delete buckled entity with target fix end (issue: #2409) Impact = LogImpact.Medium, ConfirmationPopup = true };