Prevent dereferencing null map element in footpath_remove_real

No network version increase as the client would simply crash if it were
NULL.
This commit is contained in:
Michał Janiszewski committed 2017-03-27 22:09:46 +02:00
1 parent 071c8135ba
commit 1f78afead9
1 file changed
+1 -1
+1 -1
View File
@@ -453,7 +453,7 @@ money32 footpath_remove_real(sint32 x, sint32 y, sint32 z, sint32 flags)
bool isNotOwnedByPark = (flags & (1 << 5));
bool moneyDisabled = (gParkFlags & PARK_FLAGS_NO_MONEY);
bool isGhost = map_element_is_ghost(mapElement);
bool isGhost = (mapElement == NULL) || (map_element_is_ghost(mapElement));
if (isNotOwnedByPark || moneyDisabled || isGhost) {
cost = 0;