1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Modify height search to also affect maze construction

This commit is contained in:
Tulio Leao
2020-01-19 14:04:53 -03:00
parent d2e5c29ce0
commit fabef9b050
2 changed files with 10 additions and 15 deletions

View File

@@ -3550,7 +3550,6 @@ void ride_construction_toolupdate_construct(ScreenCoordsXY screenCoords)
z -= bx;
gMapSelectArrowPosition.z = z;
bx = 41;
_currentTrackBegin.x = mapCoords->x;
_currentTrackBegin.y = mapCoords->y;
_currentTrackBegin.z = z;
@@ -3561,9 +3560,12 @@ void ride_construction_toolupdate_construct(ScreenCoordsXY screenCoords)
}
_previousTrackPiece = _currentTrackBegin;
// search for appropriate z value for ghost, up to max ride height
int numAttempts = (z <= (8 * MAX_TRACK_HEIGHT) ? MAX_TRACK_HEIGHT - (z / 8) + 1 : 2);
if (ride->type == RIDE_TYPE_MAZE)
{
for (;;)
for (int zAttempts = numAttempts; zAttempts > 1; zAttempts--)
{
window_ride_construction_update_state(
&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &mapCoords->x, &mapCoords->y, &z,
@@ -3573,16 +3575,11 @@ void ride_construction_toolupdate_construct(ScreenCoordsXY screenCoords)
if (_currentTrackPrice != MONEY32_UNDEFINED)
break;
bx--;
if (bx == 0)
break;
_currentTrackBegin.z -= 8;
if (_currentTrackBegin.z < 0)
break;
if (bx >= 0)
_currentTrackBegin.z += 16;
_currentTrackBegin.z += 16;
}
auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION);
@@ -3591,8 +3588,6 @@ void ride_construction_toolupdate_construct(ScreenCoordsXY screenCoords)
return;
}
// search for appropriate z value for ghost, up to max ride height
int numAttempts = (z <= (8 * MAX_TRACK_HEIGHT) ? MAX_TRACK_HEIGHT - (z / 8) + 1 : 2);
for (int zAttempts = numAttempts; zAttempts > 1; zAttempts--)
{
window_ride_construction_update_state(
@@ -3793,9 +3788,12 @@ void ride_construction_tooldown_construct(ScreenCoordsXY screenCoords)
z = _trackPlaceZ;
}
// search for z value to build at, up to max ride height
int numAttempts = (z <= (8 * MAX_TRACK_HEIGHT) ? MAX_TRACK_HEIGHT - (z / 8) + 1 : 2);
if (ride->type == RIDE_TYPE_MAZE)
{
for (int32_t zAttempts = 41; zAttempts >= 0; zAttempts--)
for (int32_t zAttempts = numAttempts; zAttempts > 0; zAttempts--)
{
_rideConstructionState = RIDE_CONSTRUCTION_STATE_MAZE_BUILD;
_currentTrackBegin.x = mapCoords.x;
@@ -3855,9 +3853,6 @@ void ride_construction_tooldown_construct(ScreenCoordsXY screenCoords)
return;
}
// search for z value to build at, up to max ride height
int numAttempts = (z <= (8 * MAX_TRACK_HEIGHT) ? MAX_TRACK_HEIGHT - (z / 8) + 1 : 2);
for (int32_t zAttempts = numAttempts; zAttempts > 0; zAttempts--)
{
_rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT;

View File

@@ -31,7 +31,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "16"
#define NETWORK_STREAM_VERSION "17"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static Peep* _pickup_peep = nullptr;