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/script/api/script_marine.cpp | |
parent | 21675ec7e22bfe53f20300cc27b4d50c84aeb4dc (diff) | |
download | openttd-6fe445e6c0fa3163aba48b1ec6d810b6594777bd.tar.xz |
Codechange: Un-bitstuff station/depot/waypoint commands.
Diffstat (limited to 'src/script/api/script_marine.cpp')
-rw-r--r-- | src/script/api/script_marine.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/script/api/script_marine.cpp b/src/script/api/script_marine.cpp index f368ec918..809323394 100644 --- a/src/script/api/script_marine.cpp +++ b/src/script/api/script_marine.cpp @@ -83,7 +83,7 @@ EnforcePrecondition(false, ::IsValidTile(front)); EnforcePrecondition(false, (::TileX(front) == ::TileX(tile)) != (::TileY(front) == ::TileY(tile))); - return ScriptObject::Command<CMD_BUILD_SHIP_DEPOT>::Do(tile, ::TileX(front) == ::TileX(tile), 0, {}); + return ScriptObject::Command<CMD_BUILD_SHIP_DEPOT>::Do(tile, ::TileX(front) == ::TileX(tile) ? AXIS_Y : AXIS_X); } /* static */ bool ScriptMarine::BuildDock(TileIndex tile, StationID station_id) @@ -92,9 +92,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id)); - uint p1 = station_id == ScriptStation::STATION_JOIN_ADJACENT ? 0 : 1; - uint p2 = (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; - return ScriptObject::Command<CMD_BUILD_DOCK>::Do(tile, p1, p2, {}); + return ScriptObject::Command<CMD_BUILD_DOCK>::Do(tile, ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION, station_id != ScriptStation::STATION_JOIN_ADJACENT); } /* static */ bool ScriptMarine::BuildBuoy(TileIndex tile) @@ -102,7 +100,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::Command<CMD_BUILD_BUOY>::Do(tile, 0, 0, {}); + return ScriptObject::Command<CMD_BUILD_BUOY>::Do(tile); } /* static */ bool ScriptMarine::BuildLock(TileIndex tile) |