Fix #17542: Stalls will autorotate towards paths outside the park

This commit is contained in:
Gymnasiast 2022-07-27 23:43:24 +02:00
parent f0777e5418
commit 5e8b749277
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
2 changed files with 10 additions and 2 deletions

View File

@ -18,6 +18,7 @@
- Fix: [#17508] Grid doesnt disable after setting patrol area.
- Fix: [#17533] Missing audio when specifying --rct2-data-path.
- Fix: [#17541] Station style not correctly saved to TD6.
- Fix: [#17542] Stalls will autorotate towards paths outside the park.
- Fix: [#17553] Crash when moving invention list items to empty list.
- Fix: [#17605] Crash when opening parks which have had objects removed externally.

View File

@ -3273,7 +3273,14 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
bool keepOrientation = false;
for (int8_t i = 0; i < NumOrthogonalDirections; i++)
{
pathsByDir[i] = map_get_footpath_element({ *mapCoords + CoordsDirectionDelta[i], z });
const auto testLoc = CoordsXYZ{ *mapCoords + CoordsDirectionDelta[i], z };
if (!map_is_location_owned(testLoc))
{
pathsByDir[i] = nullptr;
continue;
}
pathsByDir[i] = map_get_footpath_element(testLoc);
if (pathsByDir[i] != nullptr && (pathsByDir[i])->AsPath()->IsSloped()
&& (pathsByDir[i])->AsPath()->GetSlopeDirection() != i)
@ -3308,7 +3315,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
if (!keepOrientation)
{
for (int8_t i = 0; i < 4; i++)
for (int8_t i = 0; i < NumOrthogonalDirections; i++)
{
if (pathsByDir[i] != nullptr)
{