From 8ab3e9f0a3bc88b57b14dd9d5aadd3bddfe55339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Sat, 8 Feb 2025 23:14:37 +0100 Subject: [PATCH] Fix 3effb89: [Script] Don't set CommandCallback for asynchronous commands (#13501) --- src/script/api/script_object.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index c6533991df..edc4dae3b4 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -401,7 +401,7 @@ bool ScriptObject::ScriptDoCommandHelper if (!estimate_only && networking) ScriptObject::SetLastCommand(EndianBufferWriter::FromValue(args), Tcmd); /* Try to perform the command. */ - Tret res = ::Command::Unsafe((StringID)0, networking ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, tile, args); + Tret res = ::Command::Unsafe((StringID)0, (!asynchronous && networking) ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, tile, args); if constexpr (std::is_same_v) { return ScriptObject::DoCommandProcessResult(res, callback, estimate_only, asynchronous);