mirror of https://github.com/OpenRCT2/OpenRCT2.git
Only shift ride locations if they are not null
This commit is contained in:
parent
aa7e1e0952
commit
d48a60b700
|
@ -2239,6 +2239,18 @@ MapRange ClampRangeWithinMap(const MapRange& range)
|
|||
return validRange;
|
||||
}
|
||||
|
||||
static inline void shiftIfNotNull(TileCoordsXY& coords, const TileCoordsXY& amount)
|
||||
{
|
||||
if (!coords.IsNull())
|
||||
coords += amount;
|
||||
}
|
||||
|
||||
static inline void shiftIfNotNull(CoordsXY& coords, const CoordsXY& amount)
|
||||
{
|
||||
if (!coords.IsNull())
|
||||
coords += amount;
|
||||
}
|
||||
|
||||
void ShiftMap(const TileCoordsXY& amount)
|
||||
{
|
||||
if (amount.x == 0 && amount.y == 0)
|
||||
|
@ -2393,17 +2405,17 @@ void ShiftMap(const TileCoordsXY& amount)
|
|||
auto& stations = ride.GetStations();
|
||||
for (auto& station : stations)
|
||||
{
|
||||
station.Start += amountToMove;
|
||||
station.Entrance += amount;
|
||||
station.Exit += amount;
|
||||
shiftIfNotNull(station.Start, amountToMove);
|
||||
shiftIfNotNull(station.Entrance, amount);
|
||||
shiftIfNotNull(station.Exit, amount);
|
||||
}
|
||||
|
||||
ride.overall_view += amountToMove;
|
||||
ride.boat_hire_return_position += amount;
|
||||
ride.CurTestTrackLocation += amount;
|
||||
ride.ChairliftBullwheelLocation[0] += amount;
|
||||
ride.ChairliftBullwheelLocation[1] += amount;
|
||||
ride.CableLiftLoc += amountToMove;
|
||||
shiftIfNotNull(ride.overall_view, amountToMove);
|
||||
shiftIfNotNull(ride.boat_hire_return_position, amount);
|
||||
shiftIfNotNull(ride.CurTestTrackLocation, amount);
|
||||
shiftIfNotNull(ride.ChairliftBullwheelLocation[0], amount);
|
||||
shiftIfNotNull(ride.ChairliftBullwheelLocation[1], amount);
|
||||
shiftIfNotNull(ride.CableLiftLoc, amountToMove);
|
||||
}
|
||||
|
||||
// Banners
|
||||
|
|
Loading…
Reference in New Issue