Make SharpComponent work with Hands (#37543)

* init

* review
This commit is contained in:
ScarKy0 2025-05-17 17:27:20 +02:00 committed by deltanedas
parent fe3d58d184
commit aac5716782
1 changed files with 5 additions and 4 deletions

View 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",