Merge pull request #12372 from ZehMatt/path-underflow-warnings

Fix GetAdditionEntry trying obtain the object when no additions exist
This commit is contained in:
ζeh Matt 2020-07-24 19:20:30 +02:00 committed by GitHub
commit 76b7c4e676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1529,6 +1529,8 @@ ObjectEntryIndex PathElement::GetAdditionEntryIndex() const
rct_scenery_entry* PathElement::GetAdditionEntry() const
{
if (!HasAddition())
return nullptr;
return get_footpath_item_entry(GetAdditionEntryIndex());
}