From 597b0956fccc254001b25e81064c7af19e3733bb Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 17 Feb 2019 09:52:18 +0100 Subject: [PATCH] Fix SmallSceneryRemoveAction returning no error on invalid coordinates. --- src/openrct2/actions/SmallSceneryRemoveAction.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.hpp b/src/openrct2/actions/SmallSceneryRemoveAction.hpp index 60d6ab1925..499099afb5 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.hpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.hpp @@ -104,8 +104,7 @@ public: TileElement* tileElement = FindSceneryElement(); if (tileElement == nullptr) { - res->Cost = 0; - return res; + return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } return res; @@ -130,8 +129,7 @@ public: TileElement* tileElement = FindSceneryElement(); if (tileElement == nullptr) { - res->Cost = 0; - return res; + return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } res->Position.z = tile_element_height(res->Position.x, res->Position.y);