allow disable clearance checks for footpaths

This commit is contained in:
IntelOrca 2015-07-02 19:25:04 +01:00
parent 4fceb28017
commit 9c8be6a483
4 changed files with 21 additions and 12 deletions

View File

@ -3788,9 +3788,9 @@ STR_5451 :Open cheats window
STR_5452 :Toggle visibility of toolbars
STR_5453 :Select another ride
STR_5454 :Uncap FPS
STR_5455 :Disable clearance checks
STR_5456 :Disable support limits
STR_5455 :Enable sandbox mode
STR_5456 :Disable clearance checks
STR_5457 :Disable support limits
STR_5458 :Rotate clockwise
STR_5459 :Rotate anti-clockwise
STR_5460 :Rotate view anti-clockwise

View File

@ -1783,8 +1783,9 @@ enum {
STR_SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE = 5460,
STR_DISABLE_CLEARANCE_CHECKS = 5455,
STR_DISABLE_SUPPORT_LIMITS = 5456,
STR_ENABLE_SANDBOX_MODE = 5455,
STR_DISABLE_CLEARANCE_CHECKS = 5456,
STR_DISABLE_SUPPORT_LIMITS = 5457,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768

View File

@ -104,7 +104,8 @@ typedef enum {
enum {
DDIDX_CHEATS,
DDIDX_DISABLE_CLEARANCE_CHECKS = 2,
DDIDX_ENABLE_SANDBOX_MODE = 2,
DDIDX_DISABLE_CLEARANCE_CHECKS,
DDIDX_DISABLE_SUPPORT_LIMITS
};
@ -399,17 +400,21 @@ static void window_top_toolbar_mousedown(int widgetIndex, rct_window*w, rct_widg
gDropdownItemsFormat[1] = 0;
gDropdownItemsFormat[2] = 1156;
gDropdownItemsFormat[3] = 1156;
gDropdownItemsFormat[4] = 1156;
gDropdownItemsArgs[0] = 5217;
gDropdownItemsArgs[2] = STR_DISABLE_CLEARANCE_CHECKS;
gDropdownItemsArgs[3] = STR_DISABLE_SUPPORT_LIMITS;
gDropdownItemsArgs[2] = STR_ENABLE_SANDBOX_MODE;
gDropdownItemsArgs[3] = STR_DISABLE_CLEARANCE_CHECKS;
gDropdownItemsArgs[4] = STR_DISABLE_SUPPORT_LIMITS;
window_dropdown_show_text(
w->x + widget->left,
w->y + widget->top,
widget->bottom - widget->top + 1,
w->colours[0] | 0x80,
0,
4
5
);
if (gCheatsSandboxMode)
gDropdownItemsChecked |= (1 << DDIDX_ENABLE_SANDBOX_MODE);
if (gCheatsDisableClearanceChecks)
gDropdownItemsChecked |= (1 << DDIDX_DISABLE_CLEARANCE_CHECKS);
if (gCheatsDisableSupportLimits)
@ -508,6 +513,9 @@ static void window_top_toolbar_dropdown(rct_window *w, int widgetIndex, int drop
case DDIDX_CHEATS:
window_cheats_open();
break;
case DDIDX_ENABLE_SANDBOX_MODE:
gCheatsSandboxMode = !gCheatsSandboxMode;
break;
case DDIDX_DISABLE_CLEARANCE_CHECKS:
gCheatsDisableClearanceChecks = !gCheatsDisableClearanceChecks;
break;

View File

@ -168,11 +168,11 @@ static money32 footpath_element_insert(int type, int x, int y, int z, int slope,
// 0x006A6733 expects the flags to be at (*0xF3EF7C) + 8
RCT2_GLOBAL(0x00F3EF7C, uint32) = (uint32)(&flags - 2);
if (!map_can_construct_with_clear_at(x, y, z, zHigh, (void*)0x006A6733, bl))
if (!gCheatsDisableClearanceChecks && !map_can_construct_with_clear_at(x, y, z, zHigh, (void*)0x006A6733, bl))
return MONEY32_UNDEFINED;
RCT2_GLOBAL(0x00F3EFA4, uint8) = RCT2_GLOBAL(0x00F1AD60, uint8);
if (RCT2_GLOBAL(0x00F1AD60, uint8) & 4) {
if (!gCheatsDisableClearanceChecks && (RCT2_GLOBAL(0x00F1AD60, uint8) & 4)) {
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_CANT_BUILD_THIS_UNDERWATER;
return MONEY32_UNDEFINED;
}
@ -868,7 +868,7 @@ static void loc_6A6D7E(
) {
int x = initialX + TileDirectionDelta[direction].x;
int y = initialY + TileDirectionDelta[direction].y;
if (((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gSandboxMode) && map_is_edge(x, y)) {
if (((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && map_is_edge(x, y)) {
if (query) {
neighbour_list_push(neighbourList, 7, direction);
}