summaryrefslogtreecommitdiff
path: root/src/command_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_func.h')
-rw-r--r--src/command_func.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/command_func.h b/src/command_func.h
index 6a9b93ff5..9d603abcf 100644
--- a/src/command_func.h
+++ b/src/command_func.h
@@ -12,7 +12,7 @@
#include "command_type.h"
#include "company_type.h"
-#include <vector>
+#include "misc/endian_buffer.hpp"
#include "tile_map.h"
/**
@@ -34,9 +34,6 @@ static const CommandCost CMD_ERROR = CommandCost(INVALID_STRING_ID);
*/
#define return_cmd_error(errcode) return CommandCost(errcode);
-/** Storage buffer for serialized command data. */
-typedef std::vector<byte> CommandDataBuffer;
-
CommandCost DoCommandPInternal(Commands cmd, StringID err_message, CommandCallback *callback, bool my_cmd, bool estimate_only, bool network_command, TileIndex tile, uint32 p1, uint32 p2, const std::string &text);
void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *callback, CompanyID company, TileIndex tile, uint32 p1, uint32 p2, const std::string &text);
@@ -213,7 +210,7 @@ protected:
InternalPostResult(res, tile, estimate_only, only_sending, err_message, my_cmd);
if (!estimate_only && !only_sending && callback != nullptr) {
- std::apply(callback, std::tuple_cat(std::tuple<const CommandCost &, Commands>{ res, Tcmd }, args));
+ callback(Tcmd, res, tile, EndianBufferWriter<CommandDataBuffer>::FromValue(args));
}
return res.Succeeded();