Anchorable checks for ToolComponent in Valid method.

This commit is contained in:
Vera Aguilera Puerto
2021-10-07 22:57:21 +02:00
parent f1e56483a2
commit 6b73b89617

View File

@@ -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<ToolSystem>().UseTool(utilizing.Uid, user.Uid, Owner.Uid, 0f, 0.5f + attempt.Delay, Tool);
return await EntitySystem.Get<ToolSystem>().UseTool(utilizing.Uid, user.Uid, Owner.Uid, 0f, 0.5f + attempt.Delay, Tool, toolComponent:tool);
}
/// <summary>