Fix the stripping menu being openable without StrippingComponent (#26908)
(cherry picked from commit 24b6456735ae83dd9de53097d625f20b723c578f)
This commit is contained in:
parent
cfe5153f5d
commit
0f618756ab
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue