From 48ad60308ebf7ba4f03e82b439a66a9c1b907841 Mon Sep 17 00:00:00 2001 From: wolfreak99 Date: Thu, 23 Feb 2017 09:32:05 -0500 Subject: [PATCH] Sync "Raise / lower guest initial happiness" --- src/openrct2/editor.c | 2 +- .../windows/editor_scenario_options.c | 20 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/openrct2/editor.c b/src/openrct2/editor.c index 621a494f66..28acd3ba9e 100644 --- a/src/openrct2/editor.c +++ b/src/openrct2/editor.c @@ -597,7 +597,7 @@ void game_command_edit_scenario_options(sint32* eax, sint32* ebx, sint32* ecx, s gGuestInitialCash = max(MONEY(0, 00), min(MONEY(1000, 00), *edx)); break; case EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS: - + gGuestInitialHappiness = max(40, min(250, *edx)); break; case EDIT_SCENARIOOPTIONS_SETGUESTINITIALHUNGER: diff --git a/src/openrct2/windows/editor_scenario_options.c b/src/openrct2/windows/editor_scenario_options.c index f8813b6e0c..17a9d8817a 100644 --- a/src/openrct2/windows/editor_scenario_options.c +++ b/src/openrct2/windows/editor_scenario_options.c @@ -895,7 +895,15 @@ static void window_editor_scenario_options_guests_mousedown(sint32 widgetIndex, break; case WIDX_GUEST_INITIAL_HAPPINESS_INCREASE: if (gGuestInitialHappiness < 250) { - gGuestInitialHappiness += 4; + game_do_command( + 0, + GAME_COMMAND_FLAG_APPLY, + EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS, + gGuestInitialHappiness + 4, + GAME_COMMAND_EDIT_SCENARIO_OPTIONS, + 0, + 0 + ); } else { window_error_open(STR_CANT_INCREASE_FURTHER, STR_NONE); } @@ -903,7 +911,15 @@ static void window_editor_scenario_options_guests_mousedown(sint32 widgetIndex, break; case WIDX_GUEST_INITIAL_HAPPINESS_DECREASE: if (gGuestInitialHappiness > 40) { - gGuestInitialHappiness -= 4; + game_do_command( + 0, + GAME_COMMAND_FLAG_APPLY, + EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS, + gGuestInitialHappiness - 4, + GAME_COMMAND_EDIT_SCENARIO_OPTIONS, + 0, + 0 + ); } else { window_error_open(STR_CANT_REDUCE_FURTHER, STR_NONE); }