1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 11:33:03 +01:00

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
2017-03-27 22:09:46 +02:00
parent 071c8135ba
commit 1f78afead9

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;