From c9de9aeee0ffcafc140ff0646bcd22418626cf87 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Tue, 10 Nov 2015 21:23:16 +0000 Subject: [PATCH] fix #2051, stop queue paths connecting to three different directions --- src/world/footpath.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/world/footpath.c b/src/world/footpath.c index 8a61f1e758..d72ed3b56c 100644 --- a/src/world/footpath.c +++ b/src/world/footpath.c @@ -1326,6 +1326,17 @@ void footpath_chain_ride_queue(int rideIndex, int entranceIndex, int x, int y, r foundNextPath: if (footpath_element_is_queue(mapElement)) { + // Fix #2051: Stop queue paths that are already connected to two other tiles + // from connecting to the tile we are coming from. + int edges = mapElement->properties.path.edges; + int numEdges = bitcount(edges); + if (numEdges >= 2) { + int requiredEdgeMask = 1 << (direction ^ 2); + if (!(edges & requiredEdgeMask)) { + break; + } + } + mapElement->properties.path.type &= ~(1 << 3); mapElement->properties.path.edges |= (1 << (direction ^ 2)); mapElement->properties.path.ride_index = rideIndex;