From 6b73b89617fa3c8ea0f49ef6f69471f0251af80a Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Thu, 7 Oct 2021 22:57:21 +0200 Subject: [PATCH] Anchorable checks for ToolComponent in Valid method. --- .../Construction/Components/AnchorableComponent.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/Construction/Components/AnchorableComponent.cs b/Content.Server/Construction/Components/AnchorableComponent.cs index baceb11265..351c4b7676 100644 --- a/Content.Server/Construction/Components/AnchorableComponent.cs +++ b/Content.Server/Construction/Components/AnchorableComponent.cs @@ -47,6 +47,9 @@ namespace Content.Server.Construction.Components return false; } + if (!utilizing.TryGetComponent(out ToolComponent? tool)) + return false; + BaseAnchoredAttemptEvent attempt = anchoring ? new AnchorAttemptEvent(user, utilizing) : new UnanchorAttemptEvent(user, utilizing); @@ -59,7 +62,7 @@ namespace Content.Server.Construction.Components if (attempt.Cancelled) return false; - return await EntitySystem.Get().UseTool(utilizing.Uid, user.Uid, Owner.Uid, 0f, 0.5f + attempt.Delay, Tool); + return await EntitySystem.Get().UseTool(utilizing.Uid, user.Uid, Owner.Uid, 0f, 0.5f + attempt.Delay, Tool, toolComponent:tool); } ///