From 082f969fabfe20559b8fd72395dab1e976fc5cb9 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Tue, 11 Jun 2019 18:40:41 +0100 Subject: [PATCH] Fix #9396. Pass the ghost flag to banner remove to prevent invalid removal. Previously this would never have happened because the old code would do a scenery ghost removal before calling anything else. I think this is a better way of handling it though and don't want to revert to the old method --- src/openrct2/actions/FootpathRemoveAction.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/actions/FootpathRemoveAction.hpp b/src/openrct2/actions/FootpathRemoveAction.hpp index 34d8fce962..afac55edc2 100644 --- a/src/openrct2/actions/FootpathRemoveAction.hpp +++ b/src/openrct2/actions/FootpathRemoveAction.hpp @@ -157,7 +157,8 @@ private: auto bannerRemoveAction = BannerRemoveAction( { x, y, tileElement->base_height * 8, tileElement->AsBanner()->GetPosition() }); - bannerRemoveAction.SetFlags(GetFlags()); + auto bannerFlags = GetFlags() | (tileElement->IsGhost() ? static_cast(GAME_COMMAND_FLAG_GHOST) : 0); + bannerRemoveAction.SetFlags(bannerFlags); GameActions::ExecuteNested(&bannerRemoveAction); tileElement--; }