diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 77a65c1111..d2ca729403 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -535,7 +535,8 @@ static void WindowMazeConstructionConstruct(int32_t direction) break; } - money32 cost = maze_set_track(x, y, z, flags, false, direction, _currentRideIndex, mode); + money32 cost = maze_set_track( + CoordsXYZD{ x, y, z, static_cast(direction) }, flags, false, _currentRideIndex, mode); if (cost == MONEY32_UNDEFINED) { return; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 45d54442f6..c1f9bbb207 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -3772,8 +3772,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) gDisableErrorWindowSound = true; _trackPlaceCost = maze_set_track( - _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, GAME_COMMAND_FLAG_APPLY, true, 0, - _currentRideIndex, GC_SET_MAZE_TRACK_BUILD); + CoordsXYZD{ _currentTrackBegin, 0 }, GAME_COMMAND_FLAG_APPLY, true, _currentRideIndex, GC_SET_MAZE_TRACK_BUILD); gDisableErrorWindowSound = false; diff --git a/src/openrct2/actions/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index 86638b3de0..1e188d7ab3 100644 --- a/src/openrct2/actions/GameActionCompat.cpp +++ b/src/openrct2/actions/GameActionCompat.cpp @@ -118,11 +118,9 @@ void guest_set_name(uint16_t spriteIndex, const char* name) #pragma endregion #pragma region MazeSetTrack -money32 maze_set_track( - uint16_t x, uint16_t y, uint16_t z, uint8_t flags, bool initialPlacement, uint8_t direction, ride_id_t rideIndex, - uint8_t mode) +money32 maze_set_track(const CoordsXYZD& loc, uint8_t flags, bool initialPlacement, ride_id_t rideIndex, uint8_t mode) { - auto gameAction = MazeSetTrackAction({ x, y, z, direction }, initialPlacement, rideIndex, mode); + auto gameAction = MazeSetTrackAction(loc, initialPlacement, rideIndex, mode); gameAction.SetFlags(flags); GameActions::Result res; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index c0befc08ac..5fd8ba654a 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -492,10 +492,10 @@ void ride_remove_provisional_track_piece() { int32_t flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST; - maze_set_track(x, y, z, flags, false, 0, rideIndex, GC_SET_MAZE_TRACK_FILL); - maze_set_track(x, y + 16, z, flags, false, 1, rideIndex, GC_SET_MAZE_TRACK_FILL); - maze_set_track(x + 16, y + 16, z, flags, false, 2, rideIndex, GC_SET_MAZE_TRACK_FILL); - maze_set_track(x + 16, y, z, flags, false, 3, rideIndex, GC_SET_MAZE_TRACK_FILL); + maze_set_track(CoordsXYZD{ x, y, z, 0 }, flags, false, rideIndex, GC_SET_MAZE_TRACK_FILL); + maze_set_track(CoordsXYZD{ x, y + 16, z, 1 }, flags, false, rideIndex, GC_SET_MAZE_TRACK_FILL); + maze_set_track(CoordsXYZD{ x + 16, y + 16, z, 2 }, flags, false, rideIndex, GC_SET_MAZE_TRACK_FILL); + maze_set_track(CoordsXYZD{ x + 16, y, z, 3 }, flags, false, rideIndex, GC_SET_MAZE_TRACK_FILL); } else { diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index d2256bc979..7b9e78a007 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -577,8 +577,6 @@ roll_type_t track_get_actual_bank_3(bool useInvertedSprites, TileElement* tileEl bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flags, bool fromTrackDesign); bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, int32_t flags); -money32 maze_set_track( - uint16_t x, uint16_t y, uint16_t z, uint8_t flags, bool initialPlacement, uint8_t direction, ride_id_t rideIndex, - uint8_t mode); +money32 maze_set_track(const CoordsXYZD& coords, uint8_t flags, bool initialPlacement, ride_id_t rideIndex, uint8_t mode); bool TrackTypeHasSpeedSetting(track_type_t trackType); diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 69c3911ba2..3a908f9d1d 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -57,7 +57,7 @@ money32 place_provisional_track_piece( { int32_t flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST; // 105 - auto result = maze_set_track(trackPos.x, trackPos.y, trackPos.z, flags, true, 0, rideIndex, GC_SET_MAZE_TRACK_BUILD); + auto result = maze_set_track(CoordsXYZD{ trackPos, 0 }, flags, true, rideIndex, GC_SET_MAZE_TRACK_BUILD); if (result == MONEY32_UNDEFINED) return result;