mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Fix #13235: NPE in fix_duplicated_banners()
Co-authored-by: IntelOrca <ted@brambles.org>
This commit is contained in:
@@ -305,9 +305,13 @@ void fix_duplicated_banners()
|
||||
Guard::Assert(!activeBanners[newBannerIndex]);
|
||||
|
||||
// Copy over the original banner, but update the location
|
||||
auto& newBanner = *GetBanner(newBannerIndex);
|
||||
newBanner = *GetBanner(bannerIndex);
|
||||
newBanner.position = { x, y };
|
||||
auto newBanner = GetBanner(newBannerIndex);
|
||||
auto oldBanner = GetBanner(bannerIndex);
|
||||
if (oldBanner != nullptr && newBanner != nullptr)
|
||||
{
|
||||
*newBanner = *oldBanner;
|
||||
newBanner->position = { x, y };
|
||||
}
|
||||
|
||||
tileElement->AsBanner()->SetIndex(newBannerIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user