From 529a4da8e3b4de33c76bf572e3dfc81269a8ff8a Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Fri, 3 Jul 2015 22:58:37 +0100 Subject: [PATCH] Added zero clearance to track placement. Due to how track placement works you need to hold down shift when placing the track. Ignore the ghost placement. Also disable support limits is enabled. --- src/ride/track.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/ride/track.c b/src/ride/track.c index a07217f466..752e7c26fb 100644 --- a/src/ride/track.c +++ b/src/ride/track.c @@ -3609,8 +3609,9 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in RCT2_GLOBAL(0x00F44060, void*) = &clearance_struct; - if (!map_can_construct_with_clear_at(x, y, baseZ, clearanceZ, (void*)0x006C5A5F, bl)) { - return MONEY32_UNDEFINED; + if (!gCheatsDisableClearanceChecks || flags & (1 << 6)){ + if (!map_can_construct_with_clear_at(x, y, baseZ, clearanceZ, (void*)0x006C5A5F, bl)) + return MONEY32_UNDEFINED; } // Again when 0x006C5A5F implemented remove this. cost = clearance_struct.cost; @@ -3741,16 +3742,18 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in } //6c5648 12 push mapElement = map_get_surface_element_at(x / 32, y / 32); - int ride_height = clearanceZ - mapElement->base_height; - if (ride_height >= 0) { - int maxHeight = rideEntry->max_height; - if (maxHeight == 0) { - maxHeight = RCT2_GLOBAL(0x0097D218 + (ride->type * 8), uint8); - } - ride_height /= 2; - if (ride_height > maxHeight && !(RCT2_GLOBAL(0x009D8150, uint8) & 1)) { - RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_TOO_HIGH_FOR_SUPPORTS; - return MONEY32_UNDEFINED; + if (!gCheatsDisableSupportLimits){ + int ride_height = clearanceZ - mapElement->base_height; + if (ride_height >= 0) { + int maxHeight = rideEntry->max_height; + if (maxHeight == 0) { + maxHeight = RCT2_GLOBAL(0x0097D218 + (ride->type * 8), uint8); + } + ride_height /= 2; + if (ride_height > maxHeight && !(RCT2_GLOBAL(0x009D8150, uint8) & 1)) { + RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_TOO_HIGH_FOR_SUPPORTS; + return MONEY32_UNDEFINED; + } } }