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.
This commit is contained in:
Duncan Frost 2015-07-03 22:58:37 +01:00 committed by IntelOrca
parent da3be49f34
commit 529a4da8e3
1 changed files with 15 additions and 12 deletions

View File

@ -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;
}
}
}