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]);
|
Guard::Assert(!activeBanners[newBannerIndex]);
|
||||||
|
|
||||||
// Copy over the original banner, but update the location
|
// Copy over the original banner, but update the location
|
||||||
auto& newBanner = *GetBanner(newBannerIndex);
|
auto newBanner = GetBanner(newBannerIndex);
|
||||||
newBanner = *GetBanner(bannerIndex);
|
auto oldBanner = GetBanner(bannerIndex);
|
||||||
newBanner.position = { x, y };
|
if (oldBanner != nullptr && newBanner != nullptr)
|
||||||
|
{
|
||||||
|
*newBanner = *oldBanner;
|
||||||
|
newBanner->position = { x, y };
|
||||||
|
}
|
||||||
|
|
||||||
tileElement->AsBanner()->SetIndex(newBannerIndex);
|
tileElement->AsBanner()->SetIndex(newBannerIndex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue