diff --git a/src/cheats.c b/src/cheats.c index 8c079ca2e7..52e30cc3aa 100644 --- a/src/cheats.c +++ b/src/cheats.c @@ -125,7 +125,7 @@ static void cheat_remove_litter() continue; sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(it.element)); - if(sceneryEntry->path_bit.var_06 & (1 << 0)) + if(sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_BIN) it.element->properties.path.addition_status = 0xFF; } while (map_element_iterator_next(&it)); diff --git a/src/peep/peep.c b/src/peep/peep.c index 001959fc07..43e3e24eee 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -622,11 +622,11 @@ static void sub_68F41A(rct_peep *peep, int index) if (mapElement->base_height != peep->next_z) continue; - // Check if the footpath has ghost path scenery on it + // Check if the footpath has a queue line TV monitor on it if (footpath_element_has_path_scenery(mapElement) && footpath_element_path_scenery_is_ghost(mapElement)){ uint8 pathSceneryIndex = footpath_element_get_path_scenery_index(mapElement); rct_scenery_entry *sceneryEntry = get_footpath_item_entry(pathSceneryIndex); - if (sceneryEntry->path_bit.var_06 & (1 << 8)){ + if (sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_QUEUE_MONITOR) { found = 1; } } @@ -4272,7 +4272,7 @@ static void peep_update_emptying_bin(rct_peep* peep){ rct_scenery_entry* scenery_entry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element)); if ( - !(scenery_entry->path_bit.var_06 & 1) + !(scenery_entry->path_bit.var_06 & PATH_BIT_FLAG_BIN) || map_element->flags & (1 << 5) || footpath_element_path_scenery_is_ghost(map_element) ) { @@ -4532,7 +4532,7 @@ static int peep_update_walking_find_bench(rct_peep* peep){ if (!footpath_element_has_path_scenery(map_element)) return 0; rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element)); - if (!(sceneryEntry->path_bit.var_06 & 0x2))return 0; + if (!(sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_BENCH))return 0; if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)return 0; @@ -4607,7 +4607,7 @@ static int peep_update_walking_find_bin(rct_peep* peep){ if (!footpath_element_has_path_scenery(map_element)) return 0; rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element)); - if (!(sceneryEntry->path_bit.var_06 & 0x1))return 0; + if (!(sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_BIN))return 0; if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)return 0; @@ -4688,7 +4688,7 @@ static void peep_update_walking_break_scenery(rct_peep* peep){ if (!footpath_element_has_path_scenery(map_element)) return; rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element)); - if (!(sceneryEntry->path_bit.var_06 & 0x4))return; + if (!(sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_BREAKABLE))return; if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)return; @@ -4859,7 +4859,7 @@ static void peep_update_using_bin(rct_peep* peep){ } rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element)); - if (!(sceneryEntry->path_bit.var_06 & 1)){ + if (!(sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_BIN)){ peep_state_reset(peep); return; } @@ -5256,7 +5256,7 @@ static int peep_update_patrolling_find_bin(rct_peep* peep){ if (!footpath_element_has_path_scenery(map_element)) return 0; rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element)); - if (!(sceneryEntry->path_bit.var_06 & 1)) + if (!(sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_BIN)) return 0; if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN) @@ -5560,7 +5560,7 @@ static void peep_update_walking(rct_peep* peep){ if (!footpath_element_path_scenery_is_ghost(map_element)) { rct_scenery_entry* sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(map_element)); - if (!(sceneryEntry->path_bit.var_06 & 0x2)) ebp = 9; + if (!(sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_BENCH)) ebp = 9; } } diff --git a/src/world/footpath.c b/src/world/footpath.c index ba2a93662b..d98366fd63 100644 --- a/src/world/footpath.c +++ b/src/world/footpath.c @@ -228,22 +228,23 @@ static money32 footpath_element_update(int x, int y, rct_map_element *mapElement rct_scenery_entry* scenery_entry = get_footpath_item_entry(pathItemType - 1); uint16 unk6 = scenery_entry->path_bit.var_06; - if ((unk6 & 0x80) && (mapElement->properties.path.type & 4)) { + if ((unk6 & PATH_BIT_FLAG_DONT_ALLOW_ON_SLOPE) && footpath_element_is_sloped(mapElement)) { gGameCommandErrorText = STR_CANT_BUILD_THIS_ON_SLOPED_FOOTPATH; return MONEY32_UNDEFINED; } - if ((unk6 & 0x40) && footpath_element_is_queue(mapElement)) { + if ((unk6 & PATH_BIT_FLAG_DONT_ALLOW_ON_QUEUE) && footpath_element_is_queue(mapElement)) { gGameCommandErrorText = STR_CANNOT_PLACE_THESE_ON_QUEUE_LINE_AREA; return MONEY32_UNDEFINED; } - if (!(unk6 & 0x30) && (mapElement->properties.path.edges & 0x0F) == 0x0F) { + uint16 jfMask = PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER | PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW; + if (!(unk6 & jfMask) && (mapElement->properties.path.edges & 0x0F) == 0x0F) { gGameCommandErrorText = STR_NONE; return MONEY32_UNDEFINED; } - if ((unk6 & 0x100) && !footpath_element_is_queue(mapElement)) { + if ((unk6 & PATH_BIT_FLAG_QUEUE_MONITOR) && !footpath_element_is_queue(mapElement)) { gGameCommandErrorText = STR_CAN_ONLY_PLACE_THESE_ON_QUEUE_AREA; return MONEY32_UNDEFINED; } @@ -281,9 +282,9 @@ static money32 footpath_element_update(int x, int y, rct_map_element *mapElement mapElement->flags &= ~MAP_ELEMENT_FLAG_BROKEN; if (pathItemType != 0) { rct_scenery_entry* scenery_entry = get_footpath_item_entry(pathItemType - 1); - uint16 unk6 = scenery_entry->path_bit.var_06; - if (unk6 & 1) + if (scenery_entry->path_bit.var_06 & PATH_BIT_FLAG_BIN) { mapElement->properties.path.addition_status = 255; + } } map_invalidate_tile_full(x, y); return gParkFlags & PARK_FLAGS_NO_MONEY ? 0 : gFootpathPrice; diff --git a/src/world/scenery.h b/src/world/scenery.h index 3984dff5fa..0ba1cdb144 100644 --- a/src/world/scenery.h +++ b/src/world/scenery.h @@ -165,8 +165,15 @@ typedef struct rct_scenery_set_entry { } rct_scenery_set_entry; enum { - PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER = 1 << 4, - PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW = 1 << 5 + PATH_BIT_FLAG_BIN = 1 << 0, + PATH_BIT_FLAG_BENCH = 1 << 1, + PATH_BIT_FLAG_BREAKABLE = 1 << 2, + PATH_BIT_FLAG_LAMP = 1 << 3, + PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER = 1 << 4, + PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW = 1 << 5, + PATH_BIT_FLAG_DONT_ALLOW_ON_QUEUE = 1 << 6, + PATH_BIT_FLAG_DONT_ALLOW_ON_SLOPE = 1 << 7, + PATH_BIT_FLAG_QUEUE_MONITOR = 1 << 8, }; enum {