diff --git a/src/ride/ride.c b/src/ride/ride.c index a47baf3a6f..439e45b275 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -7659,7 +7659,7 @@ money32 place_ride_entrance_or_exit(sint16 x, sint16 y, sint16 z, uint8 directio return MONEY32_UNDEFINED; } - if (RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) & (1 << 2)) { + if (RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) & ELEMENT_IS_UNDERWATER) { RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_RIDE_CANT_BUILD_THIS_UNDERWATER; return MONEY32_UNDEFINED; } diff --git a/src/ride/track.c b/src/ride/track.c index 3ef16ebc89..71f5bfbac6 100644 --- a/src/ride/track.c +++ b/src/ride/track.c @@ -3463,11 +3463,11 @@ money32 place_maze_design(uint8 flags, uint8 rideIndex, uint16 mazeEntry, sint16 } uint8 elctgaw = RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8); - if (elctgaw & 4) { + if (elctgaw & ELEMENT_IS_UNDERWATER) { RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_RIDE_CANT_BUILD_THIS_UNDERWATER; return MONEY32_UNDEFINED; } - if (elctgaw & 2) { + if (elctgaw & ELEMENT_IS_UNDERGROUND) { RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id) = STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND; return MONEY32_UNDEFINED; } diff --git a/src/world/map.c b/src/world/map.c index a4fed6445d..34bc807cb3 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -3560,7 +3560,7 @@ void game_command_place_large_scenery(int* eax, int* ebx, int* ecx, int* edx, in return; } - if ((RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) & ELEMENT_IS_UNDERWATER) || (RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) & 2)) { + if ((RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) & ELEMENT_IS_UNDERWATER) || (RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) & ELEMENT_IS_UNDERGROUND)) { *ebx = MONEY32_UNDEFINED; return; } @@ -3981,7 +3981,7 @@ int map_can_construct_with_clear_at(int x, int y, int zLow, int zHigh, void *cle } int water_height = ((map_element->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK) * 2); if (water_height && water_height > zLow && map_element->base_height < zHigh) { - RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) |= 4; + RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) |= ELEMENT_IS_UNDERWATER; if (water_height < zHigh) { goto loc_68BAE6; } @@ -3999,7 +3999,7 @@ int map_can_construct_with_clear_at(int x, int y, int zLow, int zHigh, void *cle if ((bl & 0xF0) != 0xF0) { if (map_element->base_height >= zHigh) { // loc_68BA81 - RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) |= 2; + RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) |= ELEMENT_IS_UNDERGROUND; RCT2_GLOBAL(RCT2_ADDRESS_ELEMENT_LOCATION_COMPARED_TO_GROUND_AND_WATER, uint8) &= 0xFE; } else { int al = map_element->base_height; diff --git a/src/world/map.h b/src/world/map.h index b7607ec970..7e8f426545 100644 --- a/src/world/map.h +++ b/src/world/map.h @@ -208,7 +208,8 @@ enum { }; enum { - ELEMENT_IS_UNDERWATER = 4, + ELEMENT_IS_UNDERGROUND = 1 << 1, + ELEMENT_IS_UNDERWATER = 1 << 2, }; #define MAP_ELEMENT_QUADRANT_MASK 0xC0