1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Fix #16073: Crash in Sub6E1F34SmallScenery()

This commit is contained in:
Michael Steenbeek
2022-01-01 19:56:12 +01:00
committed by GitHub
parent 3faa0ebc4b
commit 65500461e1

View File

@@ -1267,7 +1267,13 @@ static void Sub6E1F34SmallScenery(
uint16_t maxPossibleHeight = (std::numeric_limits<decltype(TileElement::base_height)>::max() - 32) * ZoomLevel::max();
bool can_raise_item = false;
auto* sceneryEntry = get_small_scenery_entry(sceneryIndex);
const auto* sceneryEntry = get_small_scenery_entry(sceneryIndex);
if (sceneryEntry == nullptr)
{
gridPos.SetNull();
return;
}
maxPossibleHeight -= sceneryEntry->height;
if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE))
{