mirror of https://github.com/OpenRCT2/OpenRCT2.git
Minor refactor of map location compare flags.
Labelled ELEMENT_IS_UNDERGROUND.
This commit is contained in:
parent
43b723a411
commit
b8c4c46f32
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue