diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-11-14 16:39:17 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | 6fe445e6c0fa3163aba48b1ec6d810b6594777bd (patch) | |
tree | 320cd8d2d76b38ee06f9fde07ea349adeb3f228a /src/dock_gui.cpp | |
parent | 21675ec7e22bfe53f20300cc27b4d50c84aeb4dc (diff) | |
download | openttd-6fe445e6c0fa3163aba48b1ec6d810b6594777bd.tar.xz |
Codechange: Un-bitstuff station/depot/waypoint commands.
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r-- | src/dock_gui.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 328ce1c20..cdcb4ea84 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -204,7 +204,7 @@ struct BuildDocksToolbarWindow : Window { break; case WID_DT_DEPOT: // Build depot button - Command<CMD_BUILD_SHIP_DEPOT>::Post(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT, CcBuildDocks, tile, _ship_depot_direction, 0, {}); + Command<CMD_BUILD_SHIP_DEPOT>::Post(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT, CcBuildDocks, tile, _ship_depot_direction); break; case WID_DT_STATION: { // Build station button @@ -212,17 +212,12 @@ struct BuildDocksToolbarWindow : Window { DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile)); TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(tile, ReverseDiagDir(dir)) : tile); - uint32 p1 = _ctrl_pressed; - uint32 p2 = (uint32)INVALID_STATION << 16; // no station to join - + bool adjacent = _ctrl_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return Command<CMD_BUILD_DOCK>::Do(CommandFlagsToDCFlags(GetCommandFlags<CMD_BUILD_DOCK>()), tile, p1, p2, {}).Succeeded(); + return Command<CMD_BUILD_DOCK>::Do(CommandFlagsToDCFlags(GetCommandFlags<CMD_BUILD_DOCK>()), tile, 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_DOCK>::Post(STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, tile, p1, p2_final, {}); + return Command<CMD_BUILD_DOCK>::Post(STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, tile, to_join, adjacent); } }; @@ -231,7 +226,7 @@ struct BuildDocksToolbarWindow : Window { } case WID_DT_BUOY: // Build buoy button - Command<CMD_BUILD_BUOY>::Post(STR_ERROR_CAN_T_POSITION_BUOY_HERE, CcBuildDocks, tile, 0, 0, {}); + Command<CMD_BUILD_BUOY>::Post(STR_ERROR_CAN_T_POSITION_BUOY_HERE, CcBuildDocks, tile); break; case WID_DT_RIVER: // Build river button (in scenario editor) |