Rework land ownership cheat into sandbox mode

This commit is contained in:
Gymnasiast 2015-06-09 17:19:05 +02:00
parent 72de8ad103
commit 7ed434a804
9 changed files with 95 additions and 52 deletions

View File

@ -3611,9 +3611,9 @@ STR_5274 :{SMALLFONT}{BLACK}Footpath
STR_5275 :Search for Objects STR_5275 :Search for Objects
STR_5276 :Enter the name of an object to search for STR_5276 :Enter the name of an object to search for
STR_5277 :Clear STR_5277 :Clear
STR_5278 :Editable land rights STR_5278 :Sandbox mode
STR_5279 :Normal map window STR_5279 :Sandbox mode off
STR_5280 :{SMALLFONT}{BLACK}Allow editing land ownership settings through the Map window STR_5280 :{SMALLFONT}{BLACK}Allow editing land ownership settings through the Map window{NEWLINE}and other options that are normally restricted to the Scenario Editor
STR_5281 :{SMALLFONT}{BLACK}Features STR_5281 :{SMALLFONT}{BLACK}Features
STR_5282 :RCT1 Ride Open/Close Lights STR_5282 :RCT1 Ride Open/Close Lights
STR_5283 :RCT1 Park Open/Close Lights STR_5283 :RCT1 Park Open/Close Lights

25
src/cheats.h Normal file
View File

@ -0,0 +1,25 @@
/*****************************************************************************
* Copyright (c) 2015 Michael Steenbeek
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* This file is part of OpenRCT2.
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef _CHEATS_H_
#define _CHEATS_H_
int gSandboxMode;
#endif

View File

@ -31,6 +31,7 @@
#include "../world/sprite.h" #include "../world/sprite.h"
#include "../input.h" #include "../input.h"
#include "viewport.h" #include "viewport.h"
#include "../cheats.h"
static void viewport_interaction_remove_scenery(rct_map_element *mapElement, int x, int y); static void viewport_interaction_remove_scenery(rct_map_element *mapElement, int x, int y);
static void viewport_interaction_remove_footpath(rct_map_element *mapElement, int x, int y); static void viewport_interaction_remove_footpath(rct_map_element *mapElement, int x, int y);
@ -301,7 +302,7 @@ int viewport_interaction_get_item_right(int x, int y, viewport_interaction_info
return info->type; return info->type;
case VIEWPORT_INTERACTION_ITEM_PARK: case VIEWPORT_INTERACTION_ITEM_PARK:
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)) if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode)
break; break;
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_ENTRANCE) if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_ENTRANCE)

View File

@ -1482,9 +1482,9 @@ enum {
STR_GIANT_SCREENSHOT = 5260, STR_GIANT_SCREENSHOT = 5260,
STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR = 5278, STR_CHEAT_SANDBOX_MODE = 5278,
STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR_DISABLE = 5279, STR_CHEAT_SANDBOX_MODE_DISABLE = 5279,
STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR_TIP = 5280, STR_CHEAT_SANDBOX_MODE_TIP = 5280,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768 STR_COUNT = 32768

View File

@ -34,6 +34,7 @@
#include "../world/park.h" #include "../world/park.h"
#include "../world/sprite.h" #include "../world/sprite.h"
#include "../interface/themes.h" #include "../interface/themes.h"
#include "../cheats.h"
//#define WW 200 //#define WW 200
//#define WH 128 //#define WH 128
@ -72,7 +73,7 @@ enum WINDOW_CHEATS_WIDGET_IDX {
WIDX_REMOVE_LITTER, WIDX_REMOVE_LITTER,
WIDX_WIN_SCENARIO, WIDX_WIN_SCENARIO,
WIDX_UNLOCK_ALL_PRICES, WIDX_UNLOCK_ALL_PRICES,
WIDX_INGAME_LAND_OWNERSHIP_EDITOR, WIDX_SANDBOX_MODE,
WIDX_RENEW_RIDES = 8, WIDX_RENEW_RIDES = 8,
WIDX_REMOVE_SIX_FLAGS, WIDX_REMOVE_SIX_FLAGS,
WIDX_MAKE_DESTRUCTIBLE, WIDX_MAKE_DESTRUCTIBLE,
@ -155,7 +156,7 @@ static rct_widget window_cheats_misc_widgets[] = {
{ WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(5), HPL(5), STR_CHEAT_REMOVE_LITTER, STR_NONE}, // Remove litter { WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(5), HPL(5), STR_CHEAT_REMOVE_LITTER, STR_NONE}, // Remove litter
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(0), HPL(0), STR_CHEAT_WIN_SCENARIO, STR_NONE}, // Win scenario { WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(0), HPL(0), STR_CHEAT_WIN_SCENARIO, STR_NONE}, // Win scenario
{ WWT_CHECKBOX, 1, XPL(0), OWPL, YPL(8),OHPL(8), STR_CHEAT_UNLOCK_PRICES, STR_NONE}, // Unlock all prices { WWT_CHECKBOX, 1, XPL(0), OWPL, YPL(8),OHPL(8), STR_CHEAT_UNLOCK_PRICES, STR_NONE}, // Unlock all prices
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(5), HPL(5), STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR,STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR_TIP},// In-game land ownership editor { WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(5), HPL(5), STR_CHEAT_SANDBOX_MODE, STR_CHEAT_SANDBOX_MODE_TIP},// Sandbox mode (edit land ownership in-game)
{ WIDGETS_END }, { WIDGETS_END },
}; };
static rct_widget window_cheats_rides_widgets[] = { static rct_widget window_cheats_rides_widgets[] = {
@ -331,7 +332,7 @@ static void* window_cheats_page_events[] = {
static uint32 window_cheats_page_enabled_widgets[] = { static uint32 window_cheats_page_enabled_widgets[] = {
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_HIGH_MONEY) | (1 << WIDX_PARK_ENTRANCE_FEE), (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_HIGH_MONEY) | (1 << WIDX_PARK_ENTRANCE_FEE),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_HAPPY_GUESTS) | (1 << WIDX_TRAM_GUESTS) | (1 << WIDX_NAUSEA_GUESTS), (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_HAPPY_GUESTS) | (1 << WIDX_TRAM_GUESTS) | (1 << WIDX_NAUSEA_GUESTS),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_ZERO_CLEARANCE) | (1 << WIDX_WEATHER_SUN) | (1 << WIDX_WEATHER_THUNDER) | (1 << WIDX_CLEAR_GRASS) | (1 << WIDX_MOWED_GRASS) | (1 << WIDX_WATER_PLANTS) | (1 << WIDX_FIX_VANDALISM) | (1 << WIDX_REMOVE_LITTER) | (1 << WIDX_WIN_SCENARIO) | (1 << WIDX_UNLOCK_ALL_PRICES) | (1 << WIDX_INGAME_LAND_OWNERSHIP_EDITOR), (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_ZERO_CLEARANCE) | (1 << WIDX_WEATHER_SUN) | (1 << WIDX_WEATHER_THUNDER) | (1 << WIDX_CLEAR_GRASS) | (1 << WIDX_MOWED_GRASS) | (1 << WIDX_WATER_PLANTS) | (1 << WIDX_FIX_VANDALISM) | (1 << WIDX_REMOVE_LITTER) | (1 << WIDX_WIN_SCENARIO) | (1 << WIDX_UNLOCK_ALL_PRICES) | (1 << WIDX_SANDBOX_MODE),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_RENEW_RIDES) | (1 << WIDX_REMOVE_SIX_FLAGS) | (1 << WIDX_MAKE_DESTRUCTIBLE) | (1 << WIDX_FIX_ALL) | (1 << WIDX_FAST_LIFT_HILL) | (1 << WIDX_DISABLE_BRAKES_FAILURE) | (1 << WIDX_DISABLE_ALL_BREAKDOWNS) (1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_RENEW_RIDES) | (1 << WIDX_REMOVE_SIX_FLAGS) | (1 << WIDX_MAKE_DESTRUCTIBLE) | (1 << WIDX_FIX_ALL) | (1 << WIDX_FAST_LIFT_HILL) | (1 << WIDX_DISABLE_BRAKES_FAILURE) | (1 << WIDX_DISABLE_ALL_BREAKDOWNS)
}; };
@ -656,11 +657,13 @@ static void window_cheats_misc_mouseup()
window_invalidate_by_class(WC_RIDE); window_invalidate_by_class(WC_RIDE);
window_invalidate_by_class(WC_PARK_INFORMATION); window_invalidate_by_class(WC_PARK_INFORMATION);
break; break;
case WIDX_INGAME_LAND_OWNERSHIP_EDITOR: case WIDX_SANDBOX_MODE:
toggle_ingame_land_ownership_editor(); gSandboxMode = !gSandboxMode;
w->widgets[widgetIndex].image = w->widgets[widgetIndex].image == STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR ? STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR_DISABLE : STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR; w->widgets[widgetIndex].image = w->widgets[widgetIndex].image == STR_CHEAT_SANDBOX_MODE ? STR_CHEAT_SANDBOX_MODE_DISABLE : STR_CHEAT_SANDBOX_MODE;
// To prevent tools from staying active after disabling cheat // To prevent tools from staying active after disabling cheat
window_close_by_class(WC_MAP); tool_cancel();
window_invalidate_by_class(WC_MAP);
window_invalidate_by_class(WC_FOOTPATH);
break; break;
} }
} }

View File

@ -31,6 +31,7 @@
#include "../world/map.h" #include "../world/map.h"
#include "dropdown.h" #include "dropdown.h"
#include "../interface/themes.h" #include "../interface/themes.h"
#include "../cheats.h"
enum { enum {
PATH_CONSTRUCTION_MODE_LAND, PATH_CONSTRUCTION_MODE_LAND,
@ -168,6 +169,8 @@ static void footpath_get_next_path_info(int *type, int *x, int *y, int *z, int *
void window_footpath_open() void window_footpath_open()
{ {
rct_window* window; rct_window* window;
sint16 pathId;
rct_path_type *pathType;
// Check if window is already open // Check if window is already open
window = window_bring_to_front_by_class(WC_FOOTPATH); window = window_bring_to_front_by_class(WC_FOOTPATH);
@ -204,6 +207,13 @@ void window_footpath_open()
window_push_others_right(window); window_push_others_right(window);
show_gridlines(); show_gridlines();
// If a restricted path was selected when the game is no longer in Sandbox mode, reset it
pathId = RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16);
pathType = g_pathTypeEntries[pathId];
if((pathType->flags & 4) && !gSandboxMode) {
RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16) = 0;
}
tool_cancel(); tool_cancel();
RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_LAND; RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_LAND;
tool_set(window, WIDX_CONSTRUCT_ON_LAND, 17); tool_set(window, WIDX_CONSTRUCT_ON_LAND, 17);
@ -348,7 +358,7 @@ static void window_footpath_dropdown()
pathId = RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16); pathId = RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16);
} else { } else {
int flags = 4; int flags = 4;
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gSandboxMode)
flags = 0; flags = 0;
j = 0; j = 0;
@ -358,6 +368,9 @@ static void window_footpath_dropdown()
continue; continue;
if (pathType->flags & flags) if (pathType->flags & flags)
continue; continue;
// Skip queue lines of scenario editor-only paths (only applicable when the game is in sandbox mode)
if(widgetIndex == WIDX_QUEUELINE_TYPE && pathType->flags & 4)
continue;
if (j == pathId) if (j == pathId)
break; break;
@ -538,11 +551,17 @@ static void window_footpath_invalidate()
int pathImage = 71 + pathType->image; int pathImage = 71 + pathType->image;
window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage; window_footpath_widgets[WIDX_FOOTPATH_TYPE].image = pathImage;
window_footpath_widgets[WIDX_QUEUELINE_TYPE].image = pathImage + 1;
window_footpath_widgets[WIDX_QUEUELINE_TYPE].type = WWT_FLATBTN;
// Disable queue in if in editor // Disable queue line button when the path is scenario editor-only (and therefore usually shouldn't have one)
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) if(!(pathType->flags & 4)) {
window_footpath_widgets[WIDX_QUEUELINE_TYPE].image = pathImage + 1;
window_footpath_widgets[WIDX_QUEUELINE_TYPE].type = WWT_FLATBTN;
} else {
window_footpath_widgets[WIDX_QUEUELINE_TYPE].type = WWT_EMPTY;
}
// Disable queue line button if in Scenario Editor
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)
window_footpath_widgets[WIDX_QUEUELINE_TYPE].type = WWT_EMPTY; window_footpath_widgets[WIDX_QUEUELINE_TYPE].type = WWT_EMPTY;
} }
@ -606,7 +625,8 @@ static void window_footpath_show_footpath_types_dialog(rct_window *w, rct_widget
numPathTypes = 0; numPathTypes = 0;
flags = 4; flags = 4;
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2) // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor, but not their queues (since these usually shouldn't have one)
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || (gSandboxMode && !showQueues))
flags = 0; flags = 0;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {

View File

@ -27,6 +27,7 @@
#include "../sprites.h" #include "../sprites.h"
#include "../world/scenery.h" #include "../world/scenery.h"
#include "../interface/themes.h" #include "../interface/themes.h"
#include "../cheats.h"
enum WINDOW_MAP_WIDGET_IDX { enum WINDOW_MAP_WIDGET_IDX {
@ -136,10 +137,6 @@ static void* window_map_events[] = {
window_map_scrollpaint window_map_scrollpaint
}; };
// Cheat: in-game land ownership editor
int g_ingame_land_ownership_editor;
extern void toggle_ingame_land_ownership_editor();
/** /**
* *
* rct2: 0x0068C88A * rct2: 0x0068C88A
@ -546,7 +543,7 @@ static void window_map_invalidate()
w->widgets[WIDX_MAP].right = w->width - 4; w->widgets[WIDX_MAP].right = w->width - 4;
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) ||
g_ingame_land_ownership_editor) gSandboxMode)
w->widgets[WIDX_MAP].bottom = w->height - 1 - 72; w->widgets[WIDX_MAP].bottom = w->height - 1 - 72;
else if (w->selected_tab == 1) else if (w->selected_tab == 1)
w->widgets[WIDX_MAP].bottom = w->height - 1 - 44; w->widgets[WIDX_MAP].bottom = w->height - 1 - 44;
@ -593,7 +590,7 @@ static void window_map_invalidate()
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) ||
g_ingame_land_ownership_editor) { gSandboxMode) {
// scenario editor: build park entrance selected, show rotate button // scenario editor: build park entrance selected, show rotate button
if ((RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_TOOL_ACTIVE) && if ((RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_TOOL_ACTIVE) &&
RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, uint8) == WC_MAP && RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, uint8) == WC_MAP &&
@ -684,7 +681,7 @@ static void window_map_paint()
} }
if (!((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) if (!((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)
|| g_ingame_land_ownership_editor)) { || gSandboxMode)) {
// render the map legend // render the map legend
if (w->selected_tab != 0) { if (w->selected_tab != 0) {
x = w->x + 4; x = w->x + 4;
@ -973,9 +970,3 @@ static void window_map_center_on_view_point()
w_map->scrolls[0].v_top = dx; w_map->scrolls[0].v_top = dx;
widget_scroll_update_thumbs(w_map, WIDX_MAP); widget_scroll_update_thumbs(w_map, WIDX_MAP);
} }
// In-game land ownership editor cheat
void toggle_ingame_land_ownership_editor()
{
g_ingame_land_ownership_editor = !g_ingame_land_ownership_editor;
}

View File

@ -25,6 +25,7 @@
#include "footpath.h" #include "footpath.h"
#include "map.h" #include "map.h"
#include "scenery.h" #include "scenery.h"
#include "../cheats.h"
void footpath_interrupt_peeps(int x, int y, int z); void footpath_interrupt_peeps(int x, int y, int z);
@ -312,7 +313,7 @@ static money32 footpath_place_real(int type, int x, int y, int z, int slope, int
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
} }
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned(x, y, z * 8)) if (!((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gSandboxMode) && !map_is_location_owned(x, y, z * 8))
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
if (slope & 8) { if (slope & 8) {
@ -366,7 +367,7 @@ money32 footpath_remove_real(int x, int y, int z, int flags)
footpath_remove_litter(x, y, z * 8); footpath_remove_litter(x, y, z * 8);
} }
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned(x, y, z * 8)) if (!((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) || gSandboxMode) && !map_is_location_owned(x, y, z * 8))
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
mapElement = map_get_footpath_element(x / 32, y / 32, z); mapElement = map_get_footpath_element(x / 32, y / 32, z);

View File

@ -33,6 +33,7 @@
#include "map_animation.h" #include "map_animation.h"
#include "park.h" #include "park.h"
#include "scenery.h" #include "scenery.h"
#include "../cheats.h"
const rct_xy16 TileDirectionDelta[] = { const rct_xy16 TileDirectionDelta[] = {
{ -32, 0 }, { -32, 0 },
@ -656,7 +657,7 @@ void game_command_remove_scenery(int* eax, int* ebx, int* ecx, int* edx, int* es
return; return;
} }
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !(*ebx & 0x40)) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !(*ebx & 0x40) && !gSandboxMode) {
// Check if allowed to remove item // Check if allowed to remove item
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_FORBID_TREE_REMOVAL) { if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_FORBID_TREE_REMOVAL) {
if (entry->small_scenery.height > 64) { if (entry->small_scenery.height > 64) {
@ -782,7 +783,7 @@ void game_command_remove_large_scenery(int* eax, int* ebx, int* ecx, int* edx, i
currentTile.y += firstTile.y; currentTile.y += firstTile.y;
currentTile.z += firstTile.z; currentTile.z += firstTile.z;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)){ if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode){
if (!map_is_location_owned(currentTile.x, currentTile.y, currentTile.z)){ if (!map_is_location_owned(currentTile.x, currentTile.y, currentTile.z)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
@ -847,7 +848,7 @@ void game_command_remove_banner(int* eax, int* ebx, int* ecx, int* edx, int* esi
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
} }
if(!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned(x, y, z - 16)){ if(!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode && !map_is_location_owned(x, y, z - 16)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
} }
@ -894,7 +895,7 @@ void game_command_set_scenery_colour(int* eax, int* ebx, int* ecx, int* edx, int
RCT2_GLOBAL(0x009DEA5E, uint16) = x + 16; RCT2_GLOBAL(0x009DEA5E, uint16) = x + 16;
RCT2_GLOBAL(0x009DEA60, uint16) = y + 16; RCT2_GLOBAL(0x009DEA60, uint16) = y + 16;
RCT2_GLOBAL(0x009DEA62, uint16) = z; RCT2_GLOBAL(0x009DEA62, uint16) = z;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)){ if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode){
if (!map_is_location_owned(x, y, z)){ if (!map_is_location_owned(x, y, z)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
@ -944,7 +945,7 @@ void game_command_set_fence_colour(int* eax, int* ebx, int* ecx, int* edx, int*
RCT2_GLOBAL(0x009DEA5E, uint16) = x + 16; RCT2_GLOBAL(0x009DEA5E, uint16) = x + 16;
RCT2_GLOBAL(0x009DEA60, uint16) = y + 16; RCT2_GLOBAL(0x009DEA60, uint16) = y + 16;
RCT2_GLOBAL(0x009DEA62, uint16) = z; RCT2_GLOBAL(0x009DEA62, uint16) = z;
if(!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)){ if(!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode){
if(!map_is_location_in_park(x, y)){ if(!map_is_location_in_park(x, y)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
@ -1071,7 +1072,7 @@ void game_command_set_large_scenery_colour(int* eax, int* ebx, int* ecx, int* ed
x3 += x2; x3 += x2;
y3 += y2; y3 += y2;
z3 += z2; z3 += z2;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)){ if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode){
if (!map_is_location_owned(x3, y3, z3)){ if (!map_is_location_owned(x3, y3, z3)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
@ -1115,7 +1116,7 @@ void game_command_set_banner_colour(int* eax, int* ebx, int* ecx, int* edx, int*
RCT2_GLOBAL(0x009DEA60, uint16) = y + 16; RCT2_GLOBAL(0x009DEA60, uint16) = y + 16;
RCT2_GLOBAL(0x009DEA62, uint16) = z; RCT2_GLOBAL(0x009DEA62, uint16) = z;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)){ if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode){
if (!map_is_location_owned(x, y, z - 16)){ if (!map_is_location_owned(x, y, z - 16)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
@ -1322,7 +1323,7 @@ money32 map_change_surface_style(int x0, int y0, int x1, int y1, uint8 surface_s
return cur_cost; return cur_cost;
} }
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES){ if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode && RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES){
cur_cost += RCT2_GLOBAL(0x9E32B4, uint32); cur_cost += RCT2_GLOBAL(0x9E32B4, uint32);
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY){ if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY){
@ -1336,7 +1337,7 @@ money32 map_change_surface_style(int x0, int y0, int x1, int y1, uint8 surface_s
if (x > 0x1FFF)continue; if (x > 0x1FFF)continue;
if (y > 0x1FFF)continue; if (y > 0x1FFF)continue;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)){ if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode){
if (!map_is_location_in_park(x, y))continue; if (!map_is_location_in_park(x, y))continue;
} }
@ -1438,7 +1439,7 @@ static money32 sub_66397F(int flags, int x, int y, int height, int style, int se
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
} }
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode) {
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) { if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) {
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY; RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY;
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
@ -1468,7 +1469,7 @@ static money32 sub_66397F(int flags, int x, int y, int height, int style, int se
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
} }
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)) { if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode) {
if (!map_is_location_in_park(x, y)) { if (!map_is_location_in_park(x, y)) {
return MONEY32_UNDEFINED; return MONEY32_UNDEFINED;
} }
@ -1812,7 +1813,7 @@ void game_command_remove_fence(int* eax, int* ebx, int* ecx, int* edx, int* esi,
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
} }
if(!(*ebx & 0x40) && !(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned(x, y, base_height * 8)){ if(!(*ebx & 0x40) && !(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode && !map_is_location_owned(x, y, base_height * 8)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
} }
@ -1878,7 +1879,7 @@ void game_command_place_banner(int* eax, int* ebx, int* ecx, int* edx, int* esi,
return; return;
} }
} }
if(!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned(x, y, base_height * 16)){ if(!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode && !map_is_location_owned(x, y, base_height * 16)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
} }
@ -1987,7 +1988,7 @@ void game_command_place_scenery(int* eax, int* ebx, int* ecx, int* edx, int* esi
if(F64EC8 == 0){ if(F64EC8 == 0){
F64EC8 = base_height2; F64EC8 = base_height2;
} }
if(!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned(x, y, F64EC8)){ if(!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) && !gSandboxMode && !map_is_location_owned(x, y, F64EC8)){
*ebx = MONEY32_UNDEFINED; *ebx = MONEY32_UNDEFINED;
return; return;
} }
@ -2472,3 +2473,4 @@ void sub_6A7594()
{ {
RCT2_GLOBAL(0x00F3EFF4, uint32) = 0x00F3EFF8; RCT2_GLOBAL(0x00F3EFF4, uint32) = 0x00F3EFF8;
} }