Codechange: Add support for additional command result values.

This commit is contained in:
Michael Lutz
2021-11-30 00:52:23 +01:00
parent 8503854655
commit 3e85e833a7
10 changed files with 136 additions and 41 deletions

View File

@@ -13,6 +13,7 @@
#include "../script/squirrel_class.hpp"
#include "../script/script_storage.hpp"
#include "../script/script_cmd.h"
#include "../ai/ai_gui.hpp"
#include "game_config.hpp"
#include "game_info.hpp"
@@ -85,10 +86,11 @@ void GameInstance::Died()
* @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 CcGame(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data)
void CcGame(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data, CommandDataBuffer result_data)
{
if (Game::GetGameInstance()->DoCommandCallback(result, tile, data, cmd)) {
if (Game::GetGameInstance()->DoCommandCallback(result, tile, data, std::move(result_data), cmd)) {
Game::GetGameInstance()->Continue();
}
}