1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Fix #2959. Water splash correctly drawn in track preview.

Issue was caused by missing code that was used to work out the min z value required to place the ride. Without this the watersplash was placed at an invalid z value.
This commit is contained in:
duncanspumpkin
2016-02-16 18:18:43 +00:00
parent c31941c6dc
commit e7b690acac

View File

@@ -1685,6 +1685,7 @@ int track_place_ride(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint8** trac
}
if (RCT2_GLOBAL(0x00F440D4, uint8) == 3){
int temp_z = z - TrackCoordinates[track_type].z_begin;
for (const rct_preview_track* trackBlock = TrackBlocks[track_type];
trackBlock->index != 0xFF;
trackBlock++){
@@ -1742,11 +1743,10 @@ int track_place_ride(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint8** trac
height = water_height;
}
}
int temp_z = z + RCT2_GLOBAL(0x00F440D5, sint16);
temp_z -= height;
int height_diff = temp_z + RCT2_GLOBAL(0x00F440D5, sint16) + trackBlock->z - height;
if (temp_z < 0){
RCT2_GLOBAL(0x00F440D5, sint16) -= temp_z;
if (height_diff < 0){
RCT2_GLOBAL(0x00F440D5, sint16) -= height_diff;
}
}
}