1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 07:44:38 +01:00

Fix #9388: Crash using set grass length cheat

This commit is contained in:
Matt
2019-06-11 05:23:18 +02:00
parent 1b8096d4e1
commit 9a23234631

View File

@@ -356,7 +356,11 @@ private:
{
for (x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++)
{
auto surfaceElement = map_get_surface_element_at(x, y)->AsSurface();
auto tileElement = map_get_surface_element_at(x, y);
if (tileElement == nullptr)
continue;
auto surfaceElement = tileElement->AsSurface();
if (surfaceElement != nullptr && (surfaceElement->GetOwnership() & OWNERSHIP_OWNED)
&& surfaceElement->GetWaterHeight() == 0 && surfaceElement->CanGrassGrow())
{