]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make SharpComponent work with Hands (#37543)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Sat, 17 May 2025 15:27:20 +0000 (17:27 +0200)
committerGitHub <noreply@github.com>
Sat, 17 May 2025 15:27:20 +0000 (17:27 +0200)
* init

* review

Content.Server/Kitchen/EntitySystems/SharpSystem.cs

index 67a04d9601eccd0dbc09ae653c0941bb52e04b08..ab7961ba18ddf1388f24f393658ef8461dd256b4 100644 (file)
@@ -12,6 +12,7 @@ using Content.Shared.Verbs;
 using Content.Shared.Destructible;
 using Content.Shared.DoAfter;
 using Content.Shared.Hands.Components;
+using Content.Shared.IdentityManagement;
 using Content.Shared.Kitchen;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
@@ -124,7 +125,7 @@ public sealed class SharpSystem : EntitySystem
         if (hasBody)
             popupType = PopupType.LargeCaution;
 
-        _popupSystem.PopupEntity(Loc.GetString("butcherable-knife-butchered-success", ("target", args.Args.Target.Value), ("knife", uid)),
+        _popupSystem.PopupEntity(Loc.GetString("butcherable-knife-butchered-success", ("target", args.Args.Target.Value), ("knife", Identity.Entity(uid, EntityManager))),
             popupEnt, args.Args.User, popupType);
 
         if (hasBody)
@@ -152,10 +153,10 @@ public sealed class SharpSystem : EntitySystem
         var disabled = false;
         string? message = null;
 
-        // if the user has hands
-        // and the item they're holding doesn't have the SharpComponent
+        // if the held item doesn't have SharpComponent
+        // and the user doesn't have SharpComponent
         // disable the verb
-        if (!TryComp<SharpComponent>(args.Using, out var usingSharpComp) && args.Hands != null)
+        if (!TryComp<SharpComponent>(args.Using, out var usingSharpComp) && userSharpComp == null)
         {
             disabled = true;
             message = Loc.GetString("butcherable-need-knife",