Codechange: Template DoCommandPInternal.

This commit is contained in:
Michael Lutz
2021-11-01 23:07:27 +01:00
parent 6691ee3b96
commit ccefa76a46
9 changed files with 158 additions and 105 deletions

View File

@@ -371,7 +371,7 @@ bool ScriptObject::ScriptDoCommandHelper<Tcmd, CommandCost(*)(DoCommandFlag, Tar
if (!estimate_only && networking) ScriptObject::SetLastCommand(tile, EndianBufferWriter<CommandDataBuffer>::FromValue(args), Tcmd);
/* Try to perform the command. */
CommandCost res = std::apply(&DoCommandPInternal, std::tuple_cat(std::make_tuple(Tcmd, (StringID)0, networking ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, false), args));
CommandCost res = ::Command<Tcmd>::Unsafe((StringID)0, networking ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, tile, args);
return ScriptObject::DoCommandProcessResult(res, callback, estimate_only);
}