1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Use CoordsXYZD in window_ride_construction_mouseup_demolish_next_piece()

This commit is contained in:
Tulio Leao
2020-05-02 09:10:04 -03:00
parent 28b3ac1693
commit 7c82daec25
3 changed files with 8 additions and 11 deletions

View File

@@ -1958,7 +1958,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w)
if (ride != nullptr)
{
_stationConstructed = ride->num_stations != 0;
window_ride_construction_mouseup_demolish_next_piece(newCoords->x, newCoords->y, newCoords->z, direction, type);
window_ride_construction_mouseup_demolish_next_piece({ *newCoords, static_cast<Direction>(direction) }, type);
}
}
});

View File

@@ -1189,7 +1189,7 @@ void sub_6C94D8();
void ride_reset_all_names();
void window_ride_construction_mouseup_demolish_next_piece(int32_t x, int32_t y, int32_t z, int32_t direction, int32_t type);
void window_ride_construction_mouseup_demolish_next_piece(const CoordsXYZD& piecePos, int32_t type);
uint32_t ride_customers_per_hour(const Ride* ride);
uint32_t ride_customers_in_last_5_minutes(const Ride* ride);

View File

@@ -439,16 +439,15 @@ void window_ride_construction_do_station_check()
}
}
void window_ride_construction_mouseup_demolish_next_piece(int32_t x, int32_t y, int32_t z, int32_t direction, int32_t type)
void window_ride_construction_mouseup_demolish_next_piece(const CoordsXYZD& piecePos, int32_t type)
{
if (gGotoStartPlacementMode)
{
z &= 0xFFF0;
_currentTrackBegin.z = z;
_currentTrackBegin.z = piecePos.z & 0xFFF0;
_rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT;
_currentTrackSelectionFlags = 0;
_rideConstructionArrowPulseTime = 0;
_currentTrackPieceDirection = direction & 3;
_currentTrackPieceDirection = piecePos.direction & 3;
int32_t savedCurrentTrackCurve = _currentTrackCurve;
int32_t savedPreviousTrackSlopeEnd = _previousTrackSlopeEnd;
int32_t savedCurrentTrackSlopeEnd = _currentTrackSlopeEnd;
@@ -462,7 +461,7 @@ void window_ride_construction_mouseup_demolish_next_piece(int32_t x, int32_t y,
if (!ride_try_get_origin_element(ride, nullptr))
{
ride_initialise_construction_window(ride);
_currentTrackPieceDirection = direction & 3;
_currentTrackPieceDirection = piecePos.direction & 3;
if (!(savedCurrentTrackCurve & RideConstructionSpecialPieceSelected))
{
_currentTrackCurve = savedCurrentTrackCurve;
@@ -498,10 +497,8 @@ void window_ride_construction_mouseup_demolish_next_piece(int32_t x, int32_t y,
// rideConstructionState needs to be set again to the proper value, this only affects the client
_rideConstructionState = RIDE_CONSTRUCTION_STATE_SELECTED;
}
_currentTrackBegin.x = x;
_currentTrackBegin.y = y;
_currentTrackBegin.z = z;
_currentTrackPieceDirection = direction;
_currentTrackBegin = piecePos;
_currentTrackPieceDirection = piecePos.direction;
_currentTrackPieceType = type;
_currentTrackSelectionFlags = 0;
_rideConstructionArrowPulseTime = 0;