Skip to content

Commit

Permalink
Merge pull request OpenRCT2#4 from OpenRCT2/develop
Browse files Browse the repository at this point in the history
rename path bits (var_06) to (flags)
  • Loading branch information
JeroenDStout committed May 30, 2016
2 parents c6053e5 + 2a614ec commit 51a6b97
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/cheats.c
Expand Up @@ -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 & PATH_BIT_FLAG_BIN)
if(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BIN)
it.element->properties.path.addition_status = 0xFF;

} while (map_element_iterator_next(&it));
Expand Down
18 changes: 9 additions & 9 deletions src/peep/peep.c
Expand Up @@ -232,7 +232,7 @@ static uint8 peep_assess_surroundings(sint16 center_x, sint16 center_y, sint16 c
if (footpath_element_path_scenery_is_ghost(mapElement))
break;

if (scenery->path_bit.var_06 &
if (scenery->path_bit.flags &
(PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER |
PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW)){
num_fountains++;
Expand Down Expand Up @@ -626,7 +626,7 @@ static void sub_68F41A(rct_peep *peep, int index)
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 & PATH_BIT_FLAG_QUEUE_MONITOR) {
if (sceneryEntry->path_bit.flags & PATH_BIT_FLAG_QUEUE_MONITOR) {
found = 1;
}
}
Expand Down Expand Up @@ -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 & PATH_BIT_FLAG_BIN)
!(scenery_entry->path_bit.flags & PATH_BIT_FLAG_BIN)
|| map_element->flags & (1 << 5)
|| footpath_element_path_scenery_is_ghost(map_element)
) {
Expand Down Expand Up @@ -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 & PATH_BIT_FLAG_BENCH))return 0;
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BENCH))return 0;

if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)return 0;

Expand Down Expand Up @@ -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 & PATH_BIT_FLAG_BIN))return 0;
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BIN))return 0;

if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)return 0;

Expand Down Expand Up @@ -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 & PATH_BIT_FLAG_BREAKABLE))return;
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BREAKABLE))return;

if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)return;

Expand Down Expand Up @@ -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 & PATH_BIT_FLAG_BIN)){
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BIN)){
peep_state_reset(peep);
return;
}
Expand Down Expand Up @@ -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 & PATH_BIT_FLAG_BIN))
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BIN))
return 0;

if (map_element->flags & MAP_ELEMENT_FLAG_BROKEN)
Expand Down Expand Up @@ -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 & PATH_BIT_FLAG_BENCH)) ebp = 9;
if (!(sceneryEntry->path_bit.flags & PATH_BIT_FLAG_BENCH)) ebp = 9;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/world/footpath.c
Expand Up @@ -226,7 +226,7 @@ static money32 footpath_element_update(int x, int y, rct_map_element *mapElement

if (pathItemType != 0) {
rct_scenery_entry* scenery_entry = get_footpath_item_entry(pathItemType - 1);
uint16 unk6 = scenery_entry->path_bit.var_06;
uint16 unk6 = scenery_entry->path_bit.flags;

if ((unk6 & PATH_BIT_FLAG_DONT_ALLOW_ON_SLOPE) && footpath_element_is_sloped(mapElement)) {
gGameCommandErrorText = STR_CANT_BUILD_THIS_ON_SLOPED_FOOTPATH;
Expand Down Expand Up @@ -282,7 +282,7 @@ 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);
if (scenery_entry->path_bit.var_06 & PATH_BIT_FLAG_BIN) {
if (scenery_entry->path_bit.flags & PATH_BIT_FLAG_BIN) {
mapElement->properties.path.addition_status = 255;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/world/fountain.c
Expand Up @@ -302,7 +302,7 @@ static bool is_jumping_fountain(int type, int x, int y, int z)

uint8 additionIndex = footpath_element_get_path_scenery_index(mapElement);
rct_scenery_entry *sceneryEntry = get_footpath_item_entry(additionIndex);
if (!(sceneryEntry->path_bit.var_06 & pathBitFlagMask))
if (!(sceneryEntry->path_bit.flags & pathBitFlagMask))
continue;

return true;
Expand Down
4 changes: 2 additions & 2 deletions src/world/scenery.c
Expand Up @@ -82,9 +82,9 @@ void scenery_update_tile(int x, int y)
if (footpath_element_has_path_scenery(mapElement) && !footpath_element_path_scenery_is_ghost(mapElement)) {
rct_scenery_entry *sceneryEntry;
sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(mapElement));
if (sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER) {
if (sceneryEntry->path_bit.flags & PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER) {
jumping_fountain_begin(JUMPING_FOUNTAIN_TYPE_WATER, x, y, mapElement);
} else if (sceneryEntry->path_bit.var_06 & PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW) {
} else if (sceneryEntry->path_bit.flags & PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW) {
jumping_fountain_begin(JUMPING_FOUNTAIN_TYPE_SNOW, x, y, mapElement);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/world/scenery.h
Expand Up @@ -127,7 +127,7 @@ typedef enum {
} WALL_SCENERY_2_FLAGS;

typedef struct rct_path_bit_scenery_entry {
uint16 var_06;
uint16 flags; // 0x06
uint8 pad_08;
uint8 tool_id; // 0x09
sint16 price; // 0x0A
Expand Down

0 comments on commit 51a6b97

Please sign in to comment.