From 7a2a73b418f8d65782304b66b5c61efdb89f23af Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 21 Feb 2018 21:37:24 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20#7205:=20Park=20entrance=20fee=20cannot?= =?UTF-8?q?=20be=20set=20higher=20than=20=C2=A3100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/openrct2-ui/windows/EditorScenarioOptions.cpp | 2 +- src/openrct2-ui/windows/Park.cpp | 2 +- src/openrct2/Editor.cpp | 4 ++-- src/openrct2/actions/SetParkEntranceFeeAction.hpp | 2 +- src/openrct2/world/Park.h | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 4d73994ba7..2956c22579 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -1288,7 +1288,7 @@ static void window_editor_scenario_options_park_mousedown(rct_window *w, rct_wid window_invalidate(w); break; case WIDX_ENTRY_PRICE_INCREASE: - if (gParkEntranceFee < MONEY(100,00)) { + if (gParkEntranceFee < MAX_ENTRANCE_FEE) { game_do_command( 0, GAME_COMMAND_FLAG_APPLY, diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 754fcb1818..c2b206ab8f 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1215,7 +1215,7 @@ static void window_park_price_mousedown(rct_window *w, rct_widgetindex widgetInd window_park_set_page(w, widgetIndex - WIDX_TAB_1); break; case WIDX_INCREASE_PRICE: - newFee = Math::Min(MONEY(200,00), gParkEntranceFee + MONEY(1,00)); + newFee = Math::Min(MAX_ENTRANCE_FEE, gParkEntranceFee + MONEY(1,00)); park_set_entrance_fee(newFee); break; case WIDX_DECREASE_PRICE: diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 88a5f2d6be..05a5d24af1 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -333,7 +333,7 @@ namespace Editor gParkFlags &= ~PARK_FLAGS_SPRITES_INITIALISED; - gGuestInitialCash = Math::Clamp((money16)MONEY(10, 00), gGuestInitialCash, (money16)MONEY(100, 00)); + gGuestInitialCash = Math::Clamp((money16)MONEY(10, 00), gGuestInitialCash, (money16)MAX_ENTRANCE_FEE); gInitialCash = Math::Min(gInitialCash, 100000); finance_reset_cash_to_initial(); @@ -726,7 +726,7 @@ namespace Editor } break; case EDIT_SCENARIOOPTIONS_SETPARKCHARGEENTRYFEE: - gParkEntranceFee = Math::Clamp(MONEY(0, 00), *edx, MONEY(100, 00)); + gParkEntranceFee = Math::Clamp(MONEY(0, 00), *edx, MAX_ENTRANCE_FEE); window_invalidate_by_class(WC_PARK_INFORMATION); break; case EDIT_SCENARIOOPTIONS_SETFORBIDTREEREMOVAL: diff --git a/src/openrct2/actions/SetParkEntranceFeeAction.hpp b/src/openrct2/actions/SetParkEntranceFeeAction.hpp index 3c9754ec9e..bcf9b700e9 100644 --- a/src/openrct2/actions/SetParkEntranceFeeAction.hpp +++ b/src/openrct2/actions/SetParkEntranceFeeAction.hpp @@ -56,7 +56,7 @@ public: { return std::make_unique(GA_ERROR::DISALLOWED, STR_NONE); } - if (_fee < MONEY_FREE || _fee > MONEY(100,00)) + if (_fee < MONEY_FREE || _fee > MAX_ENTRANCE_FEE) { return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); } diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 498f7049d1..43261d6026 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -23,6 +23,7 @@ #define DECRYPT_MONEY(money) ((money32)rol32((money) ^ 0xF4EC9621, 13)) #define ENCRYPT_MONEY(money) ((money32)(ror32((money), 13) ^ 0xF4EC9621)) +#define MAX_ENTRANCE_FEE MONEY(200,00) enum { PARK_FLAGS_PARK_OPEN = (1 << 0),