Fix: Don't send unused tile field over the network (#10507)
This commit is contained in:
@@ -97,11 +97,10 @@ ScriptInfo *AIInstance::FindLibrary(const char *library, int version)
|
||||
* DoCommand callback function for all commands executed by AIs.
|
||||
* @param cmd cmd as given to DoCommandPInternal.
|
||||
* @param result The result of the command.
|
||||
* @param tile The tile on which the command was executed.
|
||||
* @param data Command data as given to Command<>::Post.
|
||||
* @param result_data Additional returned data from the command.
|
||||
*/
|
||||
void CcAI(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data, CommandDataBuffer result_data)
|
||||
void CcAI(Commands cmd, const CommandCost &result, const CommandDataBuffer &data, CommandDataBuffer result_data)
|
||||
{
|
||||
/*
|
||||
* The company might not exist anymore. Check for this.
|
||||
@@ -112,7 +111,7 @@ void CcAI(Commands cmd, const CommandCost &result, TileIndex tile, const Command
|
||||
const Company *c = Company::GetIfValid(_current_company);
|
||||
if (c == nullptr || c->ai_instance == nullptr) return;
|
||||
|
||||
if (c->ai_instance->DoCommandCallback(result, tile, data, std::move(result_data), cmd)) {
|
||||
if (c->ai_instance->DoCommandCallback(result, data, std::move(result_data), cmd)) {
|
||||
c->ai_instance->Continue();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user