1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 10:15:36 +01:00

Fix 19231 - Fix Tile Copy/Paste null pointer exception

This commit is contained in:
John Mulcahy
2023-04-04 05:35:20 -04:00
committed by GitHub
parent c0bd64f778
commit 18ce417dc0
2 changed files with 7 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
- Improved: [#18490] Reduce guests walking through trains on level crossing next to station.
- Improved: [#19764] Miscellaneous scenery tab now grouped next to the all-scenery tab.
- Fix: [#18895] Responding mechanic blocked at level crossing.
- Fix: [#19231] Crash due to null pointer to previously deleted banner in tile copy/paste functionality
- Fix: [#19296] Crash due to a race condition for parallel object loading.
- Fix: [#19756] Crash with title sequences containing no commands.
- Fix: [#19767] No message when path is not connected to ride exit and is therefore unreachable for mechanics.

View File

@@ -329,10 +329,15 @@ namespace OpenRCT2::TileInspector
auto tileLoc = TileCoordsXY(loc);
auto bannerIndex = element.GetBannerIndex();
if (bannerIndex != BannerIndex::GetNull() && GetBanner(bannerIndex) == nullptr)
{
return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE);
}
if (isExecuting)
{
// Check if the element to be pasted refers to a banner index
auto bannerIndex = element.GetBannerIndex();
if (bannerIndex != BannerIndex::GetNull())
{
// The element to be pasted refers to a banner index - make a copy of it