mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
Fix the stripping menu being openable without StrippingComponent (#26908)
This commit is contained in:
committed by
DEATHB4DEFEAT
parent
3c5745784f
commit
1ca87b4919
@@ -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
|
||||
{
|
||||
@@ -112,7 +112,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;
|
||||
|
||||
@@ -46,14 +46,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;
|
||||
|
||||
Reference in New Issue
Block a user