1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Check for NULL element in map_is_location_owned_or_has_rights

This commit is contained in:
Michał Janiszewski
2017-02-15 21:26:06 +01:00
parent 6f7d869639
commit b874626602

View File

@@ -829,6 +829,9 @@ bool map_is_location_owned_or_has_rights(sint32 x, sint32 y)
{
if (map_is_location_valid(x, y)) {
rct_map_element *mapElement = map_get_surface_element_at(x / 32, y / 32);
if (mapElement == NULL) {
return false;
}
if (mapElement->properties.surface.ownership & OWNERSHIP_OWNED) return true;
if (mapElement->properties.surface.ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) return true;
}