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/bridge_gui.cpp | |
parent | 0f64ee5ce1548d9cda69917f27c5b1a3cb91823d (diff) | |
download | openttd-eab18f06a47e558fe313cb86c855e8949b01feed.tar.xz |
Codechange: Pass additional data as byte stream to command callbacks.
Diffstat (limited to 'src/bridge_gui.cpp')
-rw-r--r-- | src/bridge_gui.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index e9e1f48f5..38ff698eb 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -53,18 +53,15 @@ typedef GUIList<BuildBridgeData> GUIBridgeList; ///< List of bridges, used in #B * @param result Whether the build succeeded * @param cmd unused * @param end_tile End tile of the bridge. - * @param p1 packed start tile coords (~ dx) - * @param p2 various bitstuffed elements - * - p2 = (bit 0- 7) - bridge type (hi bh) - * - p2 = (bit 8-13) - rail type or road types. - * - p2 = (bit 15-16) - transport type. - * @param text unused + * @param data Additional bitstuffed command data. */ -void CcBuildBridge(const CommandCost &result, Commands cmd, TileIndex end_tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildBridge(Commands cmd, const CommandCost &result, TileIndex end_tile, const CommandDataBuffer &data) { if (result.Failed()) return; if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_CONSTRUCTION_BRIDGE, end_tile); + auto [tile, p1, p2, text] = EndianBufferReader::ToValue<CommandTraits<CMD_BUILD_BRIDGE>::Args>(data); + TransportType transport_type = Extract<TransportType, 15, 2>(p2); if (transport_type == TRANSPORT_ROAD) { |