From bbf75bdb0ccdd2a6b818519ee40679d4cf14cf9f Mon Sep 17 00:00:00 2001 From: themias <89101928+themias@users.noreply.github.com> Date: Wed, 8 Jun 2022 05:25:47 -0400 Subject: [PATCH] Clear cancel token on failed use (#8705) --- Content.Server/Tools/ToolSystem.TilePrying.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/Tools/ToolSystem.TilePrying.cs b/Content.Server/Tools/ToolSystem.TilePrying.cs index 15ef15039a..4e9aee14ef 100644 --- a/Content.Server/Tools/ToolSystem.TilePrying.cs +++ b/Content.Server/Tools/ToolSystem.TilePrying.cs @@ -65,7 +65,7 @@ public sealed partial class ToolSystem var token = new CancellationTokenSource(); component.CancelToken = token; - UseTool( + bool success = UseTool( component.Owner, user, null, @@ -81,6 +81,9 @@ public sealed partial class ToolSystem doAfterEventTarget: component.Owner, cancelToken: token.Token); + if (!success) + component.CancelToken = null; + return true; }