1
0
Fork 0

Fix 3effb89: [Script] Don't set CommandCallback for asynchronous commands (#13501)

pull/13502/head
Loïc Guilloux 2025-02-08 23:14:37 +01:00 committed by GitHub
parent edf90f5e4b
commit 8ab3e9f0a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -401,7 +401,7 @@ bool ScriptObject::ScriptDoCommandHelper<Tcmd, Tret(*)(DoCommandFlag, Targs...)>
if (!estimate_only && networking) ScriptObject::SetLastCommand(EndianBufferWriter<CommandDataBuffer>::FromValue(args), Tcmd); if (!estimate_only && networking) ScriptObject::SetLastCommand(EndianBufferWriter<CommandDataBuffer>::FromValue(args), Tcmd);
/* Try to perform the command. */ /* Try to perform the command. */
Tret res = ::Command<Tcmd>::Unsafe((StringID)0, networking ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, tile, args); Tret res = ::Command<Tcmd>::Unsafe((StringID)0, (!asynchronous && networking) ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, tile, args);
if constexpr (std::is_same_v<Tret, CommandCost>) { if constexpr (std::is_same_v<Tret, CommandCost>) {
return ScriptObject::DoCommandProcessResult(res, callback, estimate_only, asynchronous); return ScriptObject::DoCommandProcessResult(res, callback, estimate_only, asynchronous);