From 2ce4b51528463de372f7d4a97a751b2f206324e0 Mon Sep 17 00:00:00 2001 From: Richard Jenkins Date: Mon, 27 Mar 2017 14:04:12 +0100 Subject: [PATCH] Do not return money when demolishing a ghost footpath, fixes #5318 --- src/openrct2/network/network.h | 2 +- src/openrct2/world/footpath.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index ae5b6557bc..bd366d487f 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -55,7 +55,7 @@ extern "C" { // This define specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "9" +#define NETWORK_STREAM_VERSION "10" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION #ifdef __cplusplus diff --git a/src/openrct2/world/footpath.c b/src/openrct2/world/footpath.c index 52c916b5ab..6b19f76d97 100644 --- a/src/openrct2/world/footpath.c +++ b/src/openrct2/world/footpath.c @@ -449,7 +449,17 @@ money32 footpath_remove_real(sint32 x, sint32 y, sint32 z, sint32 flags) sub_6A759F(); } - return (flags & (1 << 5)) || (gParkFlags & PARK_FLAGS_NO_MONEY) ? 0 : -MONEY(10,00); + money32 cost = -MONEY(10,00); + + bool isNotOwnedByPark = (flags & (1 << 5)); + bool moneyDisabled = (gParkFlags & PARK_FLAGS_NO_MONEY); + bool isGhost = map_element_is_ghost(mapElement); + + if (isNotOwnedByPark || moneyDisabled || isGhost) { + cost = 0; + } + + return cost; } /**