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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user