mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #15059 from ZehMatt/fix-15048
Fix #15048: Crash removing litter from cheats
This commit is contained in:
commit
935e5b28dd
|
@ -1,6 +1,7 @@
|
|||
0.3.4+ (in development)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: [#15028] Crash when placing large scenery.
|
||||
- Fix: [#15048] Crash when removing litter with cheats.
|
||||
- Fix: [#15052] Crash when using banner window.
|
||||
- Improved: [#12626] Allow using RCT2 saves to mark RCT Classic (.sea) parks as finished and vice versa.
|
||||
|
||||
|
|
|
@ -474,7 +474,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor
|
|||
{
|
||||
ft.Add<rct_string_id>(STR_BROKEN);
|
||||
}
|
||||
ft.Add<rct_string_id>(pathAddEntry->name);
|
||||
ft.Add<rct_string_id>(pathAddEntry != nullptr ? pathAddEntry->name : STR_NONE);
|
||||
SetMapTooltip(ft);
|
||||
return info;
|
||||
}
|
||||
|
|
|
@ -417,20 +417,20 @@ void SetCheatAction::RemoveLitter() const
|
|||
sprite_remove(litter);
|
||||
}
|
||||
|
||||
tile_element_iterator it;
|
||||
|
||||
tile_element_iterator it{};
|
||||
tile_element_iterator_begin(&it);
|
||||
do
|
||||
{
|
||||
if (it.element->GetType() != TILE_ELEMENT_TYPE_PATH)
|
||||
continue;
|
||||
|
||||
if (!(it.element)->AsPath()->HasAddition())
|
||||
auto* path = it.element->AsPath();
|
||||
if (path->HasAddition())
|
||||
continue;
|
||||
|
||||
auto* pathBitEntry = it.element->AsPath()->GetAdditionEntry();
|
||||
if (pathBitEntry->flags & PATH_BIT_FLAG_IS_BIN)
|
||||
it.element->AsPath()->SetAdditionStatus(0xFF);
|
||||
auto* pathBitEntry = path->GetAdditionEntry();
|
||||
if (pathBitEntry != nullptr && pathBitEntry->flags & PATH_BIT_FLAG_IS_BIN)
|
||||
path->SetAdditionStatus(0xFF);
|
||||
|
||||
} while (tile_element_iterator_next(&it));
|
||||
|
||||
|
|
Loading…
Reference in New Issue