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/industry_gui.cpp | |
parent | 0f64ee5ce1548d9cda69917f27c5b1a3cb91823d (diff) | |
download | openttd-eab18f06a47e558fe313cb86c855e8949b01feed.tar.xz |
Codechange: Pass additional data as byte stream to command callbacks.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r-- | src/industry_gui.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 29da3c76e..b66d4f8bf 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -219,17 +219,16 @@ void SortIndustryTypes() /** * Command callback. In case of failure to build an industry, show an error message. - * @param result Result of the command. * @param cmd Unused. + * @param result Result of the command. * @param tile Tile where the industry is placed. - * @param p1 Additional data of the #CMD_BUILD_INDUSTRY command. - * @param p2 Additional data of the #CMD_BUILD_INDUSTRY command. - * @param text Unused. + * @param data Additional data of the #CMD_BUILD_INDUSTRY command. */ -void CcBuildIndustry(const CommandCost &result, Commands cmd, TileIndex tile, uint32 p1, uint32 p2, const std::string &text) +void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, const CommandDataBuffer &data) { if (result.Succeeded()) return; + auto [tile_, p1, p2, text] = EndianBufferReader::ToValue<CommandTraits<CMD_BUILD_INDUSTRY>::Args>(data); uint8 indtype = GB(p1, 0, 8); if (indtype < NUM_INDUSTRYTYPES) { const IndustrySpec *indsp = GetIndustrySpec(indtype); |