1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Merge pull request #18081 from rik-smeets/fix-10535

Fix #10535: Guests getting stuck at specific level crossings.
This commit is contained in:
Michael Steenbeek
2022-09-23 22:58:13 +02:00
committed by GitHub
2 changed files with 16 additions and 19 deletions

View File

@@ -29,6 +29,7 @@
- Change: [#17762] Use vertical tabs in the New Game dialog.
- Fix: [#5141] Headless server is counted as a player.
- Fix: [#7466] Coaster track not drawn at tunnel exit.
- Fix: [#10535] Guests getting stuck at specific level crossings.
- Fix: [#14337] Guest blocking ride entrance after ride price changed to be unaffordable.
- Fix: [#15328] Wooden Roller Coaster incorrectly draws a railing on the first station piece (original bug).
- Fix: [#16392] Scenery on sloped surface is placed at wrong height.

View File

@@ -9250,29 +9250,25 @@ void Vehicle::UpdateCrossings() const
xyElement = { backVehicle->TrackLocation,
map_get_track_element_at_of_type_seq(backVehicle->TrackLocation, backVehicle->GetTrackType(), 0) };
curZ = backVehicle->TrackLocation.z;
if (xyElement.element != nullptr)
if (xyElement.element == nullptr)
{
uint8_t freeCount = travellingForwards ? 3 : 1;
return;
}
while (freeCount-- > 0)
uint8_t freeCount = travellingForwards ? 3 : 1;
while (freeCount-- > 0)
{
auto* pathElement = map_get_path_element_at(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() }));
if (pathElement != nullptr)
{
if (travellingForwards)
{
if (track_block_get_previous(xyElement, &output))
{
xyElement.x = output.begin_x;
xyElement.y = output.begin_y;
xyElement.element = output.begin_element;
}
}
pathElement->SetIsBlockedByVehicle(false);
}
auto* pathElement = map_get_path_element_at(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() }));
if (pathElement != nullptr)
{
pathElement->SetIsBlockedByVehicle(false);
}
if (travellingForwards && freeCount > 0 && track_block_get_previous(xyElement, &output))
{
xyElement.x = output.begin_x;
xyElement.y = output.begin_y;
xyElement.element = output.begin_element;
}
}
}