Fix #6238: Invalid tile elem iteration in Guest::UpdateUsingBin (#11248)

This commit is contained in:
Michał Janiszewski 2020-04-08 01:03:02 +02:00 committed by GitHub
parent 0c6828f692
commit a197e529e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -4,6 +4,7 @@
- Feature: [#11013] Ctrl+C copies input dialog text to clipboard.
- Fix: [#475] Water sides drawn incorrectly (original bug).
- Fix: [#6123, #7907, #9472, #11028] Cannot build some track designs with 4 stations (original bug).
- Fix: [#6238] Invalid tile elem iteration in Guest::UpdateUsingBin
- Fix: [#7094] Back wall edge texture in water missing.
- Fix: [#9719] Hacked walls in RCT1 saves are imported incorrectly.
- Fix: [#10928] File browser's date column is too narrow.

View File

@ -5850,7 +5850,8 @@ void Guest::UpdateUsingBin()
if (tileElement == nullptr)
return;
for (;; tileElement++)
bool found = false;
do
{
if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH)
{
@ -5858,13 +5859,16 @@ void Guest::UpdateUsingBin()
}
if (tileElement->GetBaseZ() == NextLoc.z)
break;
if (tileElement->IsLastForTile())
{
StateReset();
return;
found = true;
break;
}
} while (!(tileElement++)->IsLastForTile());
if (!found)
{
StateReset();
return;
}
if (!tileElement->AsPath()->HasAddition())