Fix the stripping menu being openable without StrippingComponent (#26908)

(cherry picked from commit 24b6456735ae83dd9de53097d625f20b723c578f)
This commit is contained in:
DrSmugleaf 2024-04-12 16:22:07 -07:00 committed by NullWanderer
parent cfe5153f5d
commit 0f618756ab
No known key found for this signature in database
GPG Key ID: 212F05528FD678BE
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,4 @@
using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.Ensnaring;
using Content.Shared.CombatMode;
@ -20,7 +21,6 @@ using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Utility;
using System.Linq;
namespace Content.Server.Strip
{
@ -111,7 +111,7 @@ namespace Content.Server.Strip
if (TryComp<CombatModeComponent>(user, out var mode) && mode.IsInCombatMode && !openInCombat)
return;
if (TryComp<ActorComponent>(user, out var actor))
if (TryComp<ActorComponent>(user, out var actor) && HasComp<StrippingComponent>(user))
{
if (_userInterfaceSystem.SessionHasOpenUi(strippable, StrippingUiKey.Key, actor.PlayerSession))
return;

View File

@ -43,14 +43,16 @@ public abstract class SharedStrippableSystem : EntitySystem
args.Handled = true;
args.CanDrop |= uid == args.User &&
HasComp<StrippableComponent>(args.Dragged) &&
HasComp<HandsComponent>(args.User);
HasComp<HandsComponent>(args.User) &&
HasComp<StrippingComponent>(args.User);
}
private void OnCanDrop(EntityUid uid, StrippableComponent component, ref CanDropDraggedEvent args)
{
args.CanDrop |= args.Target == args.User &&
HasComp<StrippingComponent>(args.User) &&
HasComp<HandsComponent>(args.User);
HasComp<HandsComponent>(args.User) &&
HasComp<StrippingComponent>(args.User);
if (args.CanDrop)
args.Handled = true;