Avoid truncating banner index; check for NULL

This commit is contained in:
Gymnasiast 2021-02-10 15:22:49 +01:00
parent 2aae1cb84e
commit 841d6a5f24
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
1 changed files with 4 additions and 1 deletions

View File

@ -288,7 +288,10 @@ void fix_duplicated_banners()
// occupy multiple tiles that should both refer to the same banner index.
if (tileElement->GetType() == TILE_ELEMENT_TYPE_BANNER)
{
uint8_t bannerIndex = tileElement->AsBanner()->GetIndex();
auto bannerIndex = tileElement->AsBanner()->GetIndex();
if (bannerIndex == BANNER_INDEX_NULL)
continue;
if (activeBanners[bannerIndex])
{
log_info(