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

Fix #16346: Crash in Staff::UpdateWatering()

This commit is contained in:
Michael Steenbeek
2022-01-01 15:07:55 +01:00
committed by GitHub
parent 875115ec33
commit 3faa0ebc4b

View File

@@ -1209,9 +1209,9 @@ void Staff::UpdateWatering()
if (abs(NextLoc.z - tile_element->GetBaseZ()) > 4 * COORDS_Z_STEP)
continue;
auto* sceneryEntry = tile_element->AsSmallScenery()->GetEntry();
const auto* sceneryEntry = tile_element->AsSmallScenery()->GetEntry();
if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_BE_WATERED))
if (sceneryEntry == nullptr || !sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_BE_WATERED))
continue;
tile_element->AsSmallScenery()->SetAge(0);