Clear cancel token on failed use (#8705)

This commit is contained in:
themias
2022-06-08 05:25:47 -04:00
committed by GitHub
parent 220bbcef18
commit bbf75bdb0c

View File

@@ -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;
}