mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #4920: Crash in peep pathfinding
This commit is contained in:
parent
e25734819b
commit
ac32e7dd08
|
@ -851,6 +851,8 @@ bool fence_in_the_way(int x, int y, int z0, int z1, int direction)
|
|||
rct_map_element *mapElement;
|
||||
|
||||
mapElement = map_get_first_element_at(x >> 5, y >> 5);
|
||||
if (mapElement == NULL)
|
||||
return false;
|
||||
do {
|
||||
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_FENCE)
|
||||
continue;
|
||||
|
|
|
@ -5146,6 +5146,10 @@ bool map_surface_is_blocked(sint16 x, sint16 y){
|
|||
|
||||
mapElement = map_get_surface_element_at(x / 32, y / 32);
|
||||
|
||||
if (mapElement == NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
sint16 water_height = mapElement->properties.surface.terrain & MAP_ELEMENT_WATER_HEIGHT_MASK;
|
||||
water_height *= 2;
|
||||
if (water_height > mapElement->base_height)
|
||||
|
|
Loading…
Reference in New Issue