From 1018ec2b331c8c43a68bf2567ee23dac83a9166f Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 16 Dec 2016 17:00:55 +0100 Subject: [PATCH] Fix #4883: Check if the map element is null before checking rights --- src/world/map.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/world/map.c b/src/world/map.c index 348cca235a..874d6b06a2 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -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) {