Skip to content

Commit

Permalink
FIX: Deleted entity delete buckled entity (#2433)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeZer2 authored Dec 30, 2024
1 parent 0625232 commit 1ca917d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Content.Server/Administration/Systems/AdminVerbSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ICommonSession, List<EditSolutionsEui>> _openSolutionUis = new();

Expand Down Expand Up @@ -447,7 +451,20 @@ private void AddDebugVerbs(GetVerbsEvent<Verb> 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<StrapComponent>(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
};
Expand Down

0 comments on commit 1ca917d

Please sign in to comment.