Fix #4883: Check if the map element is null before checking rights

This commit is contained in:
Michael Steenbeek authored and Ted John committed 2016-12-16 16:00:55 +00:00
1 parent 4669756d3e
commit 1018ec2b33
1 file changed
+5 -1
+5 -1
View File
@@ -416,7 +416,11 @@ void map_count_remaining_land_rights()
for (int x = 0; x <= 255; x++) {
for (int y = 0; y <= 255; y++) {
rct_map_element *element = map_get_surface_element_at(x, y);
// Surface elements are sometimes hacked out to save some space for other map elements
if (element == NULL) {
continue;
}
uint8 flags = element->properties.surface.ownership;
if ((flags & OWNERSHIP_AVAILABLE) && (flags & OWNERSHIP_OWNED) == 0) {