Fix #9953: Crash when hacked rides attempt to find the closest mechanic

This commit is contained in:
ζeh Matt 2019-10-03 23:08:40 +02:00 committed by Michael Steenbeek
parent 5b41afa02b
commit e4a2b1f9c5
2 changed files with 3 additions and 0 deletions

View file

@ -21,6 +21,7 @@
- Fix: [#9729] Peeps do not take into account height difference when deciding to pathfind to a ride entrance (original bug).
- Fix: [#9902] Doors/Portcullis do not check to make sure doors are open causing double opens.
- Fix: [#9926] Africa - Oasis park has wrong peep spawn (original bug).
- Fix: [#9953] Crash when hacked rides attempt to find the closest mechanic.
- Fix: [#9955] Resizing map in while pause mode does not work and may result in freezes.
- Fix: [#9957] When using 'no money' cheat, guests complain of running out of cash.
- Fix: [#9970] Wait for quarter load fails.

View file

@ -356,6 +356,8 @@ TileElement* ride_get_station_exit_element(int32_t x, int32_t y, int32_t z)
TileElement* tileElement = map_get_first_element_at(x, y);
do
{
if (tileElement == nullptr)
break;
if (tileElement->GetType() == TILE_ELEMENT_TYPE_ENTRANCE && z == tileElement->base_height)
return tileElement;
} while (!(tileElement++)->IsLastForTile());