From 6510de394beff2485ef108abbabb2f8c01b88c4f Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 17 May 2016 22:03:06 +0100 Subject: [PATCH] remove use of 0x00F1AEE0 in footpath_is_connected_to_map_edge --- src/editor.c | 2 +- src/world/footpath.c | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/editor.c b/src/editor.c index 3931b86f58..3e1208b364 100644 --- a/src/editor.c +++ b/src/editor.c @@ -652,7 +652,7 @@ bool editor_check_park() return false; case FOOTPATH_SEARCH_SUCCESS: // Run the search again and unown the path - footpath_is_connected_to_map_edge(x, y, z, direction, 0x20); + footpath_is_connected_to_map_edge(x, y, z, direction, (1 << 5)); break; } } diff --git a/src/world/footpath.c b/src/world/footpath.c index 08d9103bd8..ba2a93662b 100644 --- a/src/world/footpath.c +++ b/src/world/footpath.c @@ -1506,6 +1506,9 @@ bool get_next_direction(int edges, int *direction) /** * * rct2: 0x0069AC1A + * @param flags (1 << 0): Ignore queues + * (1 << 5): Unown + * (1 << 7): Ignore no entry signs */ int footpath_is_connected_to_map_edge_recurse( int x, int y, int z, int direction, int flags, @@ -1540,14 +1543,18 @@ int footpath_is_connected_to_map_edge_recurse( continue; } - if (mapElement->type & RCT2_GLOBAL(0x00F1AEE0, uint8)) continue; + if (!(flags & (1 << 0))) { + if (footpath_element_is_queue(mapElement)) { + continue; + } + } - if (flags & 0x20) { + if (flags & (1 << 5)) { footpath_unown(x, y, mapElement); } edges = mapElement->properties.path.edges & 0x0F; direction ^= 2; - if (!(flags & 0x80)) { + if (!(flags & (1 << 7))) { if (mapElement[1].type == MAP_ELEMENT_TYPE_BANNER) { for (int i = 1; i < 4; i++) { if (map_element_is_last_for_tile(&mapElement[i - 1])) break; @@ -1614,7 +1621,7 @@ searchFromFootpath: int footpath_is_connected_to_map_edge(int x, int y, int z, int direction, int flags) { - RCT2_GLOBAL(0x00F1AEE0, uint8) = 1; + flags |= (1 << 0); return footpath_is_connected_to_map_edge_recurse(x, y, z, direction, flags, 0, 0, 16); }