From 5fe542dd25bc89d0f218f1749460267de0d72093 Mon Sep 17 00:00:00 2001 From: Ron4u Date: Tue, 21 Jul 2020 21:22:47 +0530 Subject: [PATCH 1/2] fixed issue 12335 --- src/openrct2/world/Footpath.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 30f4991be1..6f75d7bd10 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1082,6 +1082,7 @@ void footpath_chain_ride_queue( auto targetQueuePos = curQueuePos + CoordsDirectionDelta[direction]; tileElement = map_get_first_element_at(targetQueuePos); + bool move = false; if (tileElement != nullptr) { do @@ -1097,7 +1098,9 @@ void footpath_chain_ride_queue( if (tileElement->AsPath()->GetSlopeDirection() != direction) break; } - goto foundNextPath; + move = true; + break; + } if (tileElement->GetBaseZ() == baseZ - LAND_HEIGHT_STEP) { @@ -1108,13 +1111,15 @@ void footpath_chain_ride_queue( break; baseZ -= LAND_HEIGHT_STEP; - goto foundNextPath; + move = true; + break; } } while (!(tileElement++)->IsLastForTile()); } + if(!move) break; - foundNextPath: + if (tileElement->AsPath()->IsQueue()) { // Fix #2051: Stop queue paths that are already connected to two other tiles From 247de81e3b66ecaeeca97d0373655865c2c0f2f4 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 12 Sep 2020 13:41:10 +0200 Subject: [PATCH 2/2] Apply requested fixes --- src/openrct2/world/Footpath.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 6f75d7bd10..022cbe39c8 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1082,7 +1082,7 @@ void footpath_chain_ride_queue( auto targetQueuePos = curQueuePos + CoordsDirectionDelta[direction]; tileElement = map_get_first_element_at(targetQueuePos); - bool move = false; + bool foundQueue = false; if (tileElement != nullptr) { do @@ -1098,9 +1098,8 @@ void footpath_chain_ride_queue( if (tileElement->AsPath()->GetSlopeDirection() != direction) break; } - move = true; + foundQueue = true; break; - } if (tileElement->GetBaseZ() == baseZ - LAND_HEIGHT_STEP) { @@ -1111,15 +1110,14 @@ void footpath_chain_ride_queue( break; baseZ -= LAND_HEIGHT_STEP; - move = true; + foundQueue = true; break; } } while (!(tileElement++)->IsLastForTile()); } - if(!move) - break; + if (!foundQueue) + break; - if (tileElement->AsPath()->IsQueue()) { // Fix #2051: Stop queue paths that are already connected to two other tiles