diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-10-31 22:07:22 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | eab18f06a47e558fe313cb86c855e8949b01feed (patch) | |
tree | a6dd29dc2ea3eb44ea2432151fa392ccd31c7d73 /src/vehicle_gui.cpp | |
parent | 0f64ee5ce1548d9cda69917f27c5b1a3cb91823d (diff) | |
download | openttd-eab18f06a47e558fe313cb86c855e8949b01feed.tar.xz |
Codechange: Pass additional data as byte stream to command callbacks.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index c54910150..80b75e7ce 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2622,14 +2622,13 @@ static const StringID _vehicle_msg_translation_table[][4] = { * @param result the result of the start/stop command * @param cmd unused * @param tile unused - * @param p1 vehicle ID - * @param p2 unused - * @param text unused + * @param data Command data */ -void CcStartStopVehicle(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcStartStopVehicle(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue<CommandTraits<CMD_START_STOP_VEHICLE>::Args>(data); const Vehicle *v = Vehicle::GetIfValid(p1); if (v == nullptr || !v->IsPrimaryVehicle() || v->owner != _local_company) return; @@ -3127,11 +3126,9 @@ void StopGlobalFollowVehicle(const Vehicle *v) * @param result indicates completion (or not) of the operation * @param cmd unused * @param tile unused - * @param p1 unused - * @param p2 unused - * @param text unused + * @param data unused */ -void CcBuildPrimaryVehicle(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildPrimaryVehicle(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Failed()) return; |