From 841d6a5f24c43407ddf3ecc6d1657fa71a787bfd Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 10 Feb 2021 15:22:49 +0100 Subject: [PATCH] Avoid truncating banner index; check for NULL --- src/openrct2/world/Banner.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 77b271253c..b8f389cea7 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -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(