mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #13235: NPE in fix_duplicated_banners()
Co-authored-by: IntelOrca <ted@brambles.org>
This commit is contained in:
parent
1cb3330779
commit
2aae1cb84e
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue