Remove reference to game command

This commit is contained in:
duncanspumpkin 2019-02-28 17:10:38 +00:00
parent 61cb84e0ca
commit aef3f24178
4 changed files with 2 additions and 114 deletions

View File

@ -1276,7 +1276,7 @@ GAME_COMMAND_POINTER* new_game_command_table[GAME_COMMAND_COUNT] = {
nullptr,
nullptr,
nullptr,
game_command_set_water_height,
nullptr,
game_command_place_footpath,
game_command_place_footpath_from_track,
nullptr,

View File

@ -34,7 +34,7 @@ enum GAME_COMMAND
GAME_COMMAND_REMOVE_RIDE_ENTRANCE_OR_EXIT, // GA
GAME_COMMAND_REMOVE_SCENERY, // GA
GAME_COMMAND_PLACE_SCENERY, // GA
GAME_COMMAND_SET_WATER_HEIGHT,
GAME_COMMAND_SET_WATER_HEIGHT, // GA
GAME_COMMAND_PLACE_PATH,
GAME_COMMAND_PLACE_PATH_FROM_TRACK,
GAME_COMMAND_REMOVE_PATH,

View File

@ -2149,116 +2149,6 @@ void game_command_lower_water(
(int16_t)(*eax & 0xFFFF), (int16_t)(*ecx & 0xFFFF), (int16_t)(*edi & 0xFFFF), (int16_t)(*ebp & 0xFFFF), (uint8_t)*ebx);
}
/**
*
* rct2: 0x006E650F
*/
void game_command_set_water_height(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, [[maybe_unused]] int32_t* esi, [[maybe_unused]] int32_t* edi,
[[maybe_unused]] int32_t* ebp)
{
int32_t x = *eax;
int32_t y = *ecx;
uint8_t base_height = *edx;
gCommandExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
gCommandPosition.x = x + 16;
gCommandPosition.y = y + 16;
gCommandPosition.z = base_height * 8;
if (game_is_paused() && !gCheatsBuildInPauseMode)
{
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
*ebx = MONEY32_UNDEFINED;
return;
}
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode
&& gParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)
{
gGameCommandErrorText = STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY;
*ebx = MONEY32_UNDEFINED;
return;
}
if (base_height < 2)
{
gGameCommandErrorText = STR_TOO_LOW;
*ebx = MONEY32_UNDEFINED;
return;
}
if (base_height >= 58)
{
gGameCommandErrorText = STR_TOO_HIGH;
*ebx = MONEY32_UNDEFINED;
return;
}
if (x >= gMapSizeUnits || y >= gMapSizeUnits)
{
gGameCommandErrorText = STR_OFF_EDGE_OF_MAP;
*ebx = MONEY32_UNDEFINED;
return;
}
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode && !map_is_location_in_park({ x, y }))
{
*ebx = MONEY32_UNDEFINED;
return;
}
if (*ebx & GAME_COMMAND_FLAG_APPLY)
{
int32_t element_height = tile_element_height(x, y);
footpath_remove_litter(x, y, element_height);
if (!gCheatsDisableClearanceChecks)
wall_remove_at_z(x, y, element_height);
}
TileElement* tile_element = map_get_surface_element_at({ x, y });
int32_t zHigh = tile_element->base_height;
int32_t zLow = base_height;
if (tile_element->AsSurface()->GetWaterHeight() > 0)
{
zHigh = tile_element->AsSurface()->GetWaterHeight() * 2;
}
if (zLow > zHigh)
{
int32_t temp = zHigh;
zHigh = zLow;
zLow = temp;
}
if (map_can_construct_at(x, y, zLow, zHigh, { 0b1111, 0b1111 }))
{
if (tile_element->AsSurface()->HasTrackThatNeedsWater())
{
gGameCommandErrorText = 0;
*ebx = MONEY32_UNDEFINED;
return;
}
if (*ebx & GAME_COMMAND_FLAG_APPLY)
{
if (base_height > tile_element->base_height)
{
tile_element->AsSurface()->SetWaterHeight(base_height / 2);
}
else
{
tile_element->AsSurface()->SetWaterHeight(0);
}
map_invalidate_tile_full(x, y);
}
*ebx = 250;
if (gParkFlags & PARK_FLAGS_NO_MONEY)
{
*ebx = 0;
}
}
else
{
*ebx = MONEY32_UNDEFINED;
}
}
bool map_is_location_at_edge(int32_t x, int32_t y)
{
return x < 32 || y < 32 || x >= ((MAXIMUM_MAP_SIZE_TECHNICAL - 1) * 32) || y >= ((MAXIMUM_MAP_SIZE_TECHNICAL - 1) * 32);

View File

@ -204,8 +204,6 @@ void game_command_lower_land(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t*
void game_command_smooth_land(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_raise_water(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_lower_water(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_set_water_height(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_place_banner(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
void game_command_place_wall(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);