From d5c9b90232fd0425b27f764cddaf79daa75d0482 Mon Sep 17 00:00:00 2001 From: glx22 Date: Sat, 8 Feb 2025 22:11:49 +0100 Subject: [PATCH] Fix 3effb89: [Script] Don't set CommandCallback for asynchronous commands --- 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);