Fix #8345: crash with deleted surface when using "Own all land" cheat (#8347)

This commit is contained in:
ζeh Matt 2018-12-03 19:43:36 +01:00 committed by Michał Janiszewski
parent 3c63402e1d
commit 61ef7b1c9e
1 changed files with 2 additions and 0 deletions

View File

@ -459,6 +459,8 @@ static void cheat_own_all_land()
for (coords.x = min; coords.x <= max; coords.x += 32)
{
TileElement* surfaceElement = map_get_surface_element_at(coords);
if (!surfaceElement)
continue;
// Ignore already owned tiles.
if (surfaceElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED)