From 0c7d9cd2ba26e1cc4db64a8bd677f5dade4d515c Mon Sep 17 00:00:00 2001
From: Whatstone <166147148+whatston3@users.noreply.github.com>
Date: Thu, 2 Jul 2026 15:55:59 -0400
Subject: [PATCH] Bugfix: Only raise ToolRefineAttemptEvent if used item has
needed tool qualities (#44441)
ToolRefinableSystem: check used tool before evt
---
.../Tools/Systems/ToolRefinableSystem.cs | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/Content.Shared/Tools/Systems/ToolRefinableSystem.cs b/Content.Shared/Tools/Systems/ToolRefinableSystem.cs
index 5758685ab2..edc3470ad7 100644
--- a/Content.Shared/Tools/Systems/ToolRefinableSystem.cs
+++ b/Content.Shared/Tools/Systems/ToolRefinableSystem.cs
@@ -47,7 +47,7 @@ public sealed partial class ToolRefinablSystem : EntitySystem
/// Normal interactions.
private void OnInteractUsing(Entity ent, ref InteractUsingEvent args)
{
- if (args.Handled)
+ if (args.Handled || !_toolSystem.HasQuality(args.Used, ent.Comp.QualityNeeded))
return;
var component = ent.Comp;
@@ -86,14 +86,17 @@ public sealed partial class ToolRefinablSystem : EntitySystem
? null
: Loc.GetString(ent.Comp.ToolMissingQualityTooltip, ("target", ent.Owner));
}
- // make an attempt to ensure refinement is not blocked.
- var attemptEvent = new AttemptToolRefineEvent(tool);
- RaiseLocalEvent(args.Target, ref attemptEvent);
-
- if (attemptEvent.IsCancelled)
+ else
{
- verbDisabled = true;
- verbMessage = attemptEvent.BlockCause;
+ // We have the necessary tool, make an attempt to ensure refinement is not blocked.
+ var attemptEvent = new AttemptToolRefineEvent(tool);
+ RaiseLocalEvent(args.Target, ref attemptEvent);
+
+ if (attemptEvent.IsCancelled)
+ {
+ verbDisabled = true;
+ verbMessage = attemptEvent.BlockCause;
+ }
}
verbMessage ??= component.VerbDefaultTooltip == null