From 222541f1a233caf58dccc753a419f7e88044db73 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Tue, 9 Nov 2021 11:49:31 +0100 Subject: [PATCH] Fix AnchorableSystem resolve warnings --- Content.Server/Construction/AnchorableSystem.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Content.Server/Construction/AnchorableSystem.cs b/Content.Server/Construction/AnchorableSystem.cs index d9109071f2..c4041e349f 100644 --- a/Content.Server/Construction/AnchorableSystem.cs +++ b/Content.Server/Construction/AnchorableSystem.cs @@ -26,7 +26,11 @@ namespace Content.Server.Construction private async void OnInteractUsing(EntityUid uid, AnchorableComponent anchorable, InteractUsingEvent args) { - args.Handled = await TryToggleAnchor(uid, args.User.Uid, args.Used.Uid, anchorable); + // If the used entity doesn't have a tool, return early. + if (!EntityManager.TryGetComponent(args.Used.Uid, out ToolComponent? usedTool)) + return; + + args.Handled = await TryToggleAnchor(uid, args.User.Uid, args.Used.Uid, anchorable, usingTool:usedTool); } ///