1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Fix #7572: Queue paths connect to regular paths through fences

This commit is contained in:
Joseph Atkins-Turkish
2019-09-18 14:31:30 -07:00
committed by Michael Steenbeek
parent ce41b8f793
commit 747e00512d
3 changed files with 22 additions and 7 deletions

View File

@@ -4,6 +4,7 @@
- Feature: [#9918] Increase image list capacity by about 100k units.
- Change: [#1349] Increase the number of ride music played simultaneously from 2 to 32.
- Fix: [#4927] Giant screenshot cut off at bottom and top.
- Fix: [#7572] Queue paths connect to regular paths through fences.
- Fix: [#7690] Problem with guests freezing on certain tiles of path.
- Fix: [#7883] Headless server log is stored incorrectly if server name contains CJK in Ubuntu
- Fix: [#8136] Excessive lateral G penalty is too excessive.

View File

@@ -34,7 +34,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "11"
#define NETWORK_STREAM_VERSION "12"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static Peep* _pickup_peep = nullptr;

View File

@@ -450,6 +450,10 @@ void footpath_interrupt_peeps(int32_t x, int32_t y, int32_t z)
}
/**
* Returns true if the edge of tile x, y specified by direction is occupied by a fence
* between heights z0 and z1.
*
* Note that there may still be a fence on the opposing tile.
*
* rct2: 0x006E59DC
*/
@@ -688,16 +692,26 @@ static TileElement* footpath_get_element(int32_t x, int32_t y, int32_t z0, int32
return nullptr;
}
static bool sub_footpath_disconnect_queue_from_path(
int32_t x, int32_t y, TileElement* tileElement, int32_t action, int32_t direction)
/**
* Attempt to connect a newly disconnected queue tile to the specified path tile
*/
static bool footpath_reconnect_queue_to_path(int32_t x, int32_t y, TileElement* tileElement, int32_t action, int32_t direction)
{
if (((tileElement->AsPath()->GetEdges() & (1 << direction)) == 0) ^ (action < 0))
return false;
if ((action < 0) && fence_in_the_way(x, y, tileElement->base_height, tileElement->clearance_height, direction))
return false;
int32_t x1 = x + CoordsDirectionDelta[direction].x;
int32_t y1 = y + CoordsDirectionDelta[direction].y;
if (action < 0)
{
if (fence_in_the_way(x, y, tileElement->base_height, tileElement->clearance_height, direction))
return false;
if (fence_in_the_way(x1, y1, tileElement->base_height, tileElement->clearance_height, direction_reverse(direction)))
return false;
}
int32_t z = tileElement->base_height;
TileElement* otherTileElement = footpath_get_element(x1, y1, z - 2, z, direction);
if (otherTileElement != nullptr && !otherTileElement->AsPath()->IsQueue())
@@ -737,7 +751,7 @@ static bool footpath_disconnect_queue_from_path(int32_t x, int32_t y, TileElemen
if (action < 0)
{
uint8_t direction = tileElement->AsPath()->GetSlopeDirection();
if (sub_footpath_disconnect_queue_from_path(x, y, tileElement, action, direction))
if (footpath_reconnect_queue_to_path(x, y, tileElement, action, direction))
return true;
}
@@ -745,7 +759,7 @@ static bool footpath_disconnect_queue_from_path(int32_t x, int32_t y, TileElemen
{
if ((action < 0) && (direction == tileElement->AsPath()->GetSlopeDirection()))
continue;
if (sub_footpath_disconnect_queue_from_path(x, y, tileElement, action, direction))
if (footpath_reconnect_queue_to_path(x, y, tileElement, action, direction))
return true;
}