summaryrefslogtreecommitdiff
path: root/src/airport_gui.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-11-14 16:39:17 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commit6fe445e6c0fa3163aba48b1ec6d810b6594777bd (patch)
tree320cd8d2d76b38ee06f9fde07ea349adeb3f228a /src/airport_gui.cpp
parent21675ec7e22bfe53f20300cc27b4d50c84aeb4dc (diff)
downloadopenttd-6fe445e6c0fa3163aba48b1ec6d810b6594777bd.tar.xz
Codechange: Un-bitstuff station/depot/waypoint commands.
Diffstat (limited to 'src/airport_gui.cpp')
-rw-r--r--src/airport_gui.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index 0de11c954..5efbb98a3 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -58,20 +58,16 @@ void CcBuildAirport(Commands cmd, const CommandCost &result, TileIndex tile, con
static void PlaceAirport(TileIndex tile)
{
if (_selected_airport_index == -1) return;
- uint32 p2 = _ctrl_pressed;
- SB(p2, 16, 16, INVALID_STATION); // no station to join
- uint32 p1 = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index)->GetIndex();
- p1 |= _selected_airport_layout << 8;
+ byte airport_type = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index)->GetIndex();
+ byte layout = _selected_airport_layout;
+ bool adjacent = _ctrl_pressed;
auto proc = [=](bool test, StationID to_join) -> bool {
if (test) {
- return Command<CMD_BUILD_AIRPORT>::Do(CommandFlagsToDCFlags(GetCommandFlags<CMD_BUILD_AIRPORT>()), tile, p1, p2, {}).Succeeded();
+ return Command<CMD_BUILD_AIRPORT>::Do(CommandFlagsToDCFlags(GetCommandFlags<CMD_BUILD_AIRPORT>()), tile, airport_type, layout, INVALID_STATION, adjacent).Succeeded();
} else {
- uint32 p2_final = p2;
- if (to_join != INVALID_STATION) SB(p2_final, 16, 16, to_join);
-
- return Command<CMD_BUILD_AIRPORT>::Post(STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, tile, p1, p2_final, {});
+ return Command<CMD_BUILD_AIRPORT>::Post(STR_ERROR_CAN_T_BUILD_AIRPORT_HERE, CcBuildAirport, tile, airport_type, layout, to_join, adjacent);
}
};