forked from rosebudai/OpenRCT2-Web
Create map_get_water_height()
This commit is contained in:
1 parent
41b5e8bbca
commit
46de90df86
21 files changed
+76
-57
No files matched your search
@@ -71,7 +71,7 @@ static void cheat_set_grass_length(sint32 length)
|
||||
if (map_element_get_terrain(mapElement) != TERRAIN_GRASS)
|
||||
continue;
|
||||
|
||||
if ((mapElement->properties.surface.terrain & 0x1F) > 0)
|
||||
if (map_get_water_height(mapElement) > 0)
|
||||
continue;
|
||||
|
||||
mapElement->properties.surface.grass_length = length;
|
||||
|
||||
@@ -593,7 +593,7 @@ void sub_68A15E(sint32 screenX, sint32 screenY, sint16 *x, sint16 *y, sint32 *di
|
||||
|
||||
sint16 originalZ = 0;
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_WATER) {
|
||||
originalZ = (myMapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) << 4;
|
||||
originalZ = map_get_water_height(myMapElement) << 4;
|
||||
}
|
||||
|
||||
rct_xy16 start_vp_pos = screen_coord_to_viewport_coord(viewport, screenX, screenY);
|
||||
|
||||
@@ -230,8 +230,9 @@ static void sub_68B3FB(sint32 x, sint32 y)
|
||||
element--;
|
||||
|
||||
if (map_element_get_type(element) == MAP_ELEMENT_TYPE_SURFACE &&
|
||||
(element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) != 0){
|
||||
max_height = (element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) << 1;
|
||||
(map_get_water_height(element) > 0))
|
||||
{
|
||||
max_height = map_get_water_height(element) * 2;
|
||||
}
|
||||
|
||||
max_height *= 8;
|
||||
|
||||
@@ -755,7 +755,7 @@ static void viewport_surface_draw_water_side_top(enum edge_t edge, uint8 height,
|
||||
regs.ah = 1;
|
||||
regs.ch = 1;
|
||||
} else {
|
||||
regs.dh = neighbour.map_element->properties.surface.terrain & 0x1F;
|
||||
regs.dh = map_get_water_height(neighbour.map_element);
|
||||
if (regs.dl == regs.dh) {
|
||||
return;
|
||||
}
|
||||
@@ -867,7 +867,7 @@ static void viewport_surface_draw_water_side_bottom(enum edge_t edge, uint8 heig
|
||||
regs.ch = 1;
|
||||
regs.ah = 1;
|
||||
} else {
|
||||
regs.dh = neighbour.map_element->properties.surface.terrain & 0x1F;
|
||||
regs.dh = map_get_water_height(neighbour.map_element);
|
||||
if (regs.dl == regs.dh) {
|
||||
return;
|
||||
}
|
||||
@@ -1254,8 +1254,9 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement)
|
||||
sint32 local_surfaceShape = surfaceShape;
|
||||
sint32 local_height = height;
|
||||
// Water tool
|
||||
if (mapElement->properties.surface.terrain & 0x1F) {
|
||||
sint32 waterHeight = (mapElement->properties.surface.terrain & 0x1F) * 16;
|
||||
if (map_get_water_height(mapElement) > 0)
|
||||
{
|
||||
sint32 waterHeight = map_get_water_height(mapElement) * 16;
|
||||
if (waterHeight > height) {
|
||||
local_height += 16;
|
||||
|
||||
@@ -1369,12 +1370,13 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (mapElement->properties.surface.terrain & 0x1F) {
|
||||
if (map_get_water_height(mapElement) > 0)
|
||||
{
|
||||
// loc_6615A9: (water height)
|
||||
gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_WATER;
|
||||
|
||||
uint16 localHeight = height + 16;
|
||||
uint16 waterHeight = (mapElement->properties.surface.terrain & 0x1F) * 16;
|
||||
uint16 waterHeight = map_get_water_height(mapElement) * 16;
|
||||
|
||||
if (!gTrackDesignSaveMode) {
|
||||
gUnk141E9DC = waterHeight;
|
||||
|
||||
@@ -2112,8 +2112,9 @@ static void peep_update_falling(rct_peep* peep){
|
||||
} // If a surface get the height and see if we are on it
|
||||
else if (map_element_get_type(map_element) == MAP_ELEMENT_TYPE_SURFACE) {
|
||||
// If the surface is water check to see if we could be drowning
|
||||
if (map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) {
|
||||
sint32 height = (map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) * 16;
|
||||
if (map_get_water_height(map_element) > 0)
|
||||
{
|
||||
sint32 height = map_get_water_height(map_element) * 16;
|
||||
|
||||
if (height - 4 >= peep->z && height < peep->z + 20) {
|
||||
// Looks like we are drowning!
|
||||
@@ -6324,7 +6325,7 @@ static void peep_update_patrolling(rct_peep* peep){
|
||||
rct_map_element* map_element = map_get_surface_element_at(peep->next_x / 32, peep->next_y / 32);
|
||||
|
||||
if (map_element != NULL){
|
||||
sint32 water_height = map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
sint32 water_height = map_get_water_height(map_element);
|
||||
if (water_height){
|
||||
invalidate_sprite_2((rct_sprite*)peep);
|
||||
water_height *= 16;
|
||||
@@ -6498,7 +6499,7 @@ static void peep_update_walking(rct_peep* peep){
|
||||
if ((peep->next_var_29 & 0x18) == 8){
|
||||
rct_map_element* map_element = map_get_surface_element_at(peep->next_x / 32, peep->next_y / 32);
|
||||
|
||||
sint32 water_height = map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
sint32 water_height = map_get_water_height(map_element);
|
||||
if (water_height){
|
||||
invalidate_sprite_2((rct_sprite*)peep);
|
||||
water_height *= 16;
|
||||
@@ -10533,7 +10534,7 @@ static sint32 peep_perform_next_action(rct_peep *peep)
|
||||
if (mapElement == NULL)
|
||||
return peep_return_to_centre_of_tile(peep);
|
||||
|
||||
sint16 water_height = mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
sint16 water_height = map_get_water_height(mapElement);
|
||||
if (water_height)
|
||||
return peep_return_to_centre_of_tile(peep);
|
||||
|
||||
|
||||
@@ -498,7 +498,7 @@ static void ride_ratings_score_close_proximity(rct_map_element *inputMapElement)
|
||||
if (mapElement->base_height * 8 == gRideRatingsCalcData.proximity_z) {
|
||||
proximity_score_increment(PROXIMITY_SURFACE_TOUCH);
|
||||
}
|
||||
sint32 waterHeight = (mapElement->properties.surface.terrain & 0x1F);
|
||||
sint32 waterHeight = map_get_water_height(mapElement);
|
||||
if (waterHeight != 0) {
|
||||
sint32 z = waterHeight * 16;
|
||||
if (z <= gRideRatingsCalcData.proximity_z) {
|
||||
|
||||
@@ -1170,7 +1170,7 @@ static money32 track_place(sint32 rideIndex, sint32 type, sint32 originX, sint32
|
||||
if ((rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) && !byte_9D8150) {
|
||||
mapElement = map_get_surface_element_at(x / 32, y / 32);
|
||||
|
||||
uint8 water_height = 2 * (mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK);
|
||||
uint8 water_height = map_get_water_height(mapElement) * 2;
|
||||
if (water_height == 0) {
|
||||
gGameCommandErrorText = STR_CAN_ONLY_BUILD_THIS_ON_WATER;
|
||||
return MONEY32_UNDEFINED;
|
||||
|
||||
@@ -1023,8 +1023,8 @@ static sint32 track_design_place_maze(rct_track_td6 *td6, sint16 x, sint16 y, si
|
||||
}
|
||||
}
|
||||
|
||||
if (map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) {
|
||||
sint16 water_height = map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
if (map_get_water_height(map_element) > 0) {
|
||||
sint16 water_height = map_get_water_height(map_element);
|
||||
water_height *= 16;
|
||||
if (water_height > map_height) {
|
||||
map_height = water_height;
|
||||
@@ -1164,7 +1164,7 @@ static bool track_design_place_ride(rct_track_td6 *td6, sint16 x, sint16 y, sint
|
||||
}
|
||||
}
|
||||
|
||||
uint8 water_height = 16 * mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
uint8 water_height = map_get_water_height(mapElement) * 16;
|
||||
if (water_height > 0 && water_height > height) {
|
||||
height = water_height;
|
||||
}
|
||||
|
||||
@@ -4082,7 +4082,7 @@ static bool vehicle_is_boat_on_water(rct_vehicle *vehicle, sint32 x, sint32 y)
|
||||
rct_map_element *mapElement = map_get_first_element_at(x >> 5, y >> 5);
|
||||
do {
|
||||
if (map_element_get_type(mapElement) == MAP_ELEMENT_TYPE_SURFACE) {
|
||||
sint32 waterZ = (mapElement->properties.surface.terrain & 0x1F) * 2;
|
||||
sint32 waterZ = map_get_water_height(mapElement) * 2;
|
||||
if (z != waterZ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1215,7 +1215,7 @@ static void place_park_entrance_get_map_position(sint32 x, sint32 y, sint16 *map
|
||||
return;
|
||||
|
||||
mapElement = map_get_surface_element_at(*mapX >> 5, *mapY >> 5);
|
||||
*mapZ = mapElement->properties.surface.terrain & 0x1F;
|
||||
*mapZ = map_get_water_height(mapElement);
|
||||
if (*mapZ == 0) {
|
||||
*mapZ = mapElement->base_height / 2;
|
||||
if ((mapElement->properties.surface.slope & 0x0F) != 0) {
|
||||
@@ -1585,7 +1585,7 @@ static uint16 map_window_get_pixel_colour_peep(sint32 x, sint32 y)
|
||||
|
||||
mapElement = map_get_surface_element_at(x >> 5, y >> 5);
|
||||
colour = TerrainColour[map_element_get_terrain(mapElement)];
|
||||
if (mapElement->properties.surface.terrain & 0x1F)
|
||||
if (map_get_water_height(mapElement) > 0)
|
||||
colour = WaterColour;
|
||||
|
||||
if (!(mapElement->properties.surface.ownership & OWNERSHIP_OWNED))
|
||||
@@ -1615,7 +1615,7 @@ static uint16 map_window_get_pixel_colour_ride(sint32 x, sint32 y)
|
||||
do {
|
||||
switch (map_element_get_type(mapElement)) {
|
||||
case MAP_ELEMENT_TYPE_SURFACE:
|
||||
if (mapElement->properties.surface.terrain & 0x1F) {
|
||||
if (map_get_water_height(mapElement) > 0) {
|
||||
colour &= 0xFFFF;
|
||||
colour |= FALLBACK_COLOUR(PALETTE_INDEX_194);
|
||||
}
|
||||
|
||||
@@ -1662,7 +1662,7 @@ static void window_tile_inspector_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, &landOwnership, COLOUR_DARK_GREEN, x, y + 22);
|
||||
|
||||
// Water level
|
||||
sint32 waterLevel = mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
sint32 waterLevel = map_get_water_height(mapElement);
|
||||
gfx_draw_string_left(dpi, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, &waterLevel, COLOUR_DARK_GREEN, x, y + 33);
|
||||
|
||||
// Properties
|
||||
|
||||
@@ -1282,7 +1282,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid
|
||||
}
|
||||
|
||||
gSceneryPlaceZ = 0;
|
||||
uint16 water_height = map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
uint16 water_height = map_get_water_height(map_element);
|
||||
if (water_height != 0) {
|
||||
gSceneryPlaceZ = water_height * 16;
|
||||
}
|
||||
|
||||
@@ -419,8 +419,8 @@ static sint32 window_track_place_get_base_z(sint32 x, sint32 y)
|
||||
}
|
||||
|
||||
// Increase Z above water
|
||||
if (mapElement->properties.surface.terrain & 0x1F)
|
||||
z = max(z, (mapElement->properties.surface.terrain & 0x1F) << 4);
|
||||
if (map_get_water_height(mapElement) > 0)
|
||||
z = max(z, map_get_water_height(mapElement) << 4);
|
||||
|
||||
return z + place_virtual_track(_trackDesign, PTD_OPERATION_GET_PLACE_Z, true, 0, x, y, z);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ void rct_duck::UpdateFlyToWater()
|
||||
sint32 manhattanDistanceN = abs(target_x - newX) + abs(target_y - newY);
|
||||
|
||||
rct_map_element * mapElement = map_get_surface_element_at(target_x >> 5, target_y >> 5);
|
||||
sint32 waterHeight = mapElement->properties.surface.terrain & 0x1F;
|
||||
sint32 waterHeight = map_get_water_height(mapElement);
|
||||
if (waterHeight == 0)
|
||||
{
|
||||
state = DUCK_STATE::FLY_AWAY;
|
||||
|
||||
@@ -275,9 +275,9 @@ static money32 SmallSceneryPlace(sint16 x,
|
||||
|
||||
rct_map_element* surfaceElement = map_get_surface_element_at(x / 32, y / 32);
|
||||
|
||||
if (!gCheatsDisableClearanceChecks && (surfaceElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK))
|
||||
if (!gCheatsDisableClearanceChecks && map_get_water_height(surfaceElement) > 0)
|
||||
{
|
||||
sint32 water_height = ((surfaceElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) * 16) - 1;
|
||||
sint32 water_height = (map_get_water_height(surfaceElement) * 16) - 1;
|
||||
if (water_height > targetHeight)
|
||||
{
|
||||
gGameCommandErrorText = STR_CANT_BUILD_THIS_UNDERWATER;
|
||||
@@ -293,9 +293,9 @@ static money32 SmallSceneryPlace(sint16 x,
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
|
||||
if (surfaceElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK)
|
||||
if (map_get_water_height(surfaceElement) > 0)
|
||||
{
|
||||
if (((surfaceElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) * 16) > targetHeight)
|
||||
if ((map_get_water_height(surfaceElement) * 16) > targetHeight)
|
||||
{
|
||||
gGameCommandErrorText = STR_CAN_ONLY_BUILD_THIS_ON_LAND;
|
||||
return MONEY32_UNDEFINED;
|
||||
@@ -321,7 +321,7 @@ static money32 SmallSceneryPlace(sint16 x,
|
||||
|
||||
if (!isOnWater)
|
||||
{
|
||||
if ((surfaceElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) ||
|
||||
if (map_get_water_height(surfaceElement) ||
|
||||
(surfaceElement->base_height * 8) != targetHeight)
|
||||
{
|
||||
|
||||
|
||||
+27
-17
@@ -517,7 +517,7 @@ sint32 map_element_height(sint32 x, sint32 y)
|
||||
}
|
||||
|
||||
uint32 height =
|
||||
((mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) << 20) |
|
||||
(map_get_water_height(mapElement) << 20) |
|
||||
(mapElement->base_height << 3);
|
||||
|
||||
uint32 slope = (mapElement->properties.surface.slope & MAP_ELEMENT_SLOPE_MASK);
|
||||
@@ -1364,10 +1364,14 @@ static money32 map_change_surface_style(sint32 x0, sint32 y0, sint32 x1, sint32
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & 1) {
|
||||
if (!(mapElement->properties.surface.terrain & MAP_ELEMENT_SURFACE_TERRAIN_MASK)) {
|
||||
if (!(mapElement->type & MAP_ELEMENT_DIRECTION_MASK)) {
|
||||
if ((mapElement->properties.surface.grass_length & 7) != GRASS_LENGTH_CLEAR_0) {
|
||||
if (flags & 1)
|
||||
{
|
||||
if (map_get_water_height(mapElement) == 0)
|
||||
{
|
||||
if (!(mapElement->type & MAP_ELEMENT_DIRECTION_MASK))
|
||||
{
|
||||
if ((mapElement->properties.surface.grass_length & 7) != GRASS_LENGTH_CLEAR_0)
|
||||
{
|
||||
mapElement->properties.surface.grass_length = GRASS_LENGTH_CLEAR_0;
|
||||
map_invalidate_tile_full(x, y);
|
||||
}
|
||||
@@ -1538,7 +1542,7 @@ static money32 map_set_land_height(sint32 flags, sint32 x, sint32 y, sint32 heig
|
||||
rct_map_element *surfaceElement = map_get_surface_element_at(x / 32, y / 32);
|
||||
if(surfaceElement->type & MAP_ELEMENT_TYPE_FLAG_HIGHLIGHT)
|
||||
{
|
||||
sint32 waterHeight = surfaceElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
sint32 waterHeight = map_get_water_height(surfaceElement);
|
||||
if(waterHeight != 0)
|
||||
{
|
||||
if(style & 0x1F)
|
||||
@@ -1827,6 +1831,11 @@ static money32 lower_land(sint32 flags, sint32 x, sint32 y, sint32 z, sint32 ax,
|
||||
return cost;
|
||||
}
|
||||
|
||||
sint32 map_get_water_height(const rct_map_element * mapElement)
|
||||
{
|
||||
return mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
}
|
||||
|
||||
money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
||||
{
|
||||
money32 cost = 0;
|
||||
@@ -1844,8 +1853,8 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
||||
rct_map_element* map_element = map_get_surface_element_at(xi / 32, yi / 32);
|
||||
if (map_element != NULL) {
|
||||
uint8 height = map_element->base_height;
|
||||
if (map_element->properties.surface.terrain & 0x1F)
|
||||
height = (map_element->properties.surface.terrain & 0x1F) * 2;
|
||||
if (map_get_water_height(map_element) > 0)
|
||||
height = map_get_water_height(map_element) * 2;
|
||||
if (max_height > height)
|
||||
max_height = height;
|
||||
}
|
||||
@@ -1857,7 +1866,7 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
||||
rct_map_element* map_element = map_get_surface_element_at(xi / 32, yi / 32);
|
||||
if (map_element != NULL) {
|
||||
if (map_element->base_height <= max_height){
|
||||
uint8 height = (map_element->properties.surface.terrain & 0x1F);
|
||||
uint8 height = map_get_water_height(map_element);
|
||||
if (height != 0) {
|
||||
height *= 2;
|
||||
if (height > max_height)
|
||||
@@ -1924,7 +1933,7 @@ money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
||||
for (sint32 xi = x0; xi <= x1; xi += 32){
|
||||
rct_map_element* map_element = map_get_surface_element_at(xi / 32, yi / 32);
|
||||
if (map_element != NULL) {
|
||||
uint8 height = map_element->properties.surface.terrain & 0x1F;
|
||||
uint8 height = map_get_water_height(map_element);
|
||||
if (height != 0) {
|
||||
height *= 2;
|
||||
if (height > min_height)
|
||||
@@ -1938,7 +1947,7 @@ money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
|
||||
for (sint32 xi = x0; xi <= x1; xi += 32) {
|
||||
rct_map_element* map_element = map_get_surface_element_at(xi / 32, yi / 32);
|
||||
if (map_element != NULL) {
|
||||
uint8 height = (map_element->properties.surface.terrain & 0x1F);
|
||||
uint8 height = map_get_water_height(map_element);
|
||||
if (height != 0) {
|
||||
height *= 2;
|
||||
if (height < min_height)
|
||||
@@ -2454,8 +2463,9 @@ void game_command_set_water_height(sint32* eax, sint32* ebx, sint32* ecx, sint32
|
||||
rct_map_element* map_element = map_get_surface_element_at(x / 32, y / 32);
|
||||
sint32 zHigh = map_element->base_height;
|
||||
sint32 zLow = base_height;
|
||||
if(map_element->properties.surface.terrain & 0x1F){
|
||||
zHigh = (map_element->properties.surface.terrain & 0x1F) * 2;
|
||||
if (map_get_water_height(map_element) > 0)
|
||||
{
|
||||
zHigh = map_get_water_height(map_element) * 2;
|
||||
}
|
||||
if(zLow > zHigh){
|
||||
sint32 temp = zHigh;
|
||||
@@ -3144,7 +3154,7 @@ sint32 map_can_construct_with_clear_at(sint32 x, sint32 y, sint32 zLow, sint32 z
|
||||
}
|
||||
continue;
|
||||
}
|
||||
sint32 water_height = ((map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) * 2);
|
||||
sint32 water_height = map_get_water_height(map_element) * 2;
|
||||
if (water_height && water_height > zLow && map_element->base_height < zHigh) {
|
||||
gMapGroundFlags |= ELEMENT_IS_UNDERWATER;
|
||||
if (water_height < zHigh) {
|
||||
@@ -3282,7 +3292,7 @@ static void map_update_grass_length(sint32 x, sint32 y, rct_map_element *mapElem
|
||||
sint32 grassLength = mapElement->properties.surface.grass_length & 7;
|
||||
|
||||
// Check if grass is underwater or outside park
|
||||
sint32 waterHeight = (mapElement->properties.surface.terrain & 0x1F) * 2;
|
||||
sint32 waterHeight = map_get_water_height(mapElement) * 2;
|
||||
if (waterHeight > mapElement->base_height || !map_is_location_in_park(x, y)) {
|
||||
if (grassLength != GRASS_LENGTH_CLEAR_0)
|
||||
map_set_grass_length(x, y, mapElement, GRASS_LENGTH_CLEAR_0);
|
||||
@@ -3628,7 +3638,7 @@ sint32 map_get_highest_z(sint32 tileX, sint32 tileY)
|
||||
if ((mapElement->properties.surface.slope & 0x10) != 0)
|
||||
z += 16;
|
||||
|
||||
z = max(z, (mapElement->properties.surface.terrain & 0x1F) * 16);
|
||||
z = max(z, map_get_water_height(mapElement) * 16);
|
||||
return z;
|
||||
}
|
||||
|
||||
@@ -3925,7 +3935,7 @@ bool map_surface_is_blocked(sint16 x, sint16 y){
|
||||
return true;
|
||||
}
|
||||
|
||||
sint16 water_height = mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
sint16 water_height = map_get_water_height(mapElement);
|
||||
water_height *= 2;
|
||||
if (water_height > mapElement->base_height)
|
||||
return true;
|
||||
|
||||
@@ -487,6 +487,7 @@ sint32 map_can_construct_at(sint32 x, sint32 y, sint32 zLow, sint32 zHigh, uint8
|
||||
void rotate_map_coordinates(sint16 *x, sint16 *y, sint32 rotation);
|
||||
rct_xy16 coordinate_3d_to_2d(const rct_xyz16* coordinate_3d, sint32 rotation);
|
||||
money32 map_clear_scenery(sint32 x0, sint32 y0, sint32 x1, sint32 y1, sint32 clear, sint32 flags);
|
||||
sint32 map_get_water_height(const rct_map_element * mapElement);
|
||||
money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags);
|
||||
money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags);
|
||||
money32 wall_place(sint32 type, sint32 x, sint32 y, sint32 z, sint32 edge, sint32 primaryColour, sint32 secondaryColour, sint32 tertiaryColour, sint32 flags);
|
||||
|
||||
@@ -398,10 +398,10 @@ sint32 tile_smooth(sint32 x, sint32 y)
|
||||
{
|
||||
// All corners are raised, raise the entire tile instead.
|
||||
surfaceElement->base_height = (surfaceElement->clearance_height += 2);
|
||||
uint8 waterHeight = (surfaceElement->properties.surface.terrain & 0x1F) * 2;
|
||||
uint8 waterHeight = map_get_water_height(surfaceElement) * 2;
|
||||
if (waterHeight <= surfaceElement->base_height)
|
||||
{
|
||||
surfaceElement->properties.surface.terrain &= ~0x1F;
|
||||
surfaceElement->properties.surface.terrain &= ~MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -313,7 +313,7 @@ static void mapgen_place_trees()
|
||||
rct_map_element *mapElement = map_get_surface_element_at(x, y);
|
||||
|
||||
// Exclude water tiles
|
||||
if ((mapElement->properties.surface.terrain & 0x1F) != 0)
|
||||
if (map_get_water_height(mapElement) > 0)
|
||||
continue;
|
||||
|
||||
pos = &availablePositions[availablePositionsCount++];
|
||||
|
||||
@@ -374,10 +374,9 @@ static money32 WallPlace(uint8 wallType,
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
|
||||
if (surfaceElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK)
|
||||
if (map_get_water_height(surfaceElement) > 0)
|
||||
{
|
||||
uint16 waterHeight = surfaceElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
waterHeight *= 16;
|
||||
uint16 waterHeight = map_get_water_height(surfaceElement) * 16;
|
||||
|
||||
if (position.z < waterHeight && !gCheatsDisableClearanceChecks)
|
||||
{
|
||||
|
||||
@@ -202,6 +202,11 @@ void map_element_decrement_onride_photo_timout(rct_map_element * mapElement)
|
||||
}
|
||||
}
|
||||
|
||||
sint32 map_get_water_height(const rct_map_element * mapElement)
|
||||
{
|
||||
return mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
}
|
||||
|
||||
bool ride_type_has_flag(int rideType, int flag)
|
||||
{
|
||||
return (RideProperties[rideType].flags & flag) != 0;
|
||||
|
||||
Reference in new issue
Block a user