1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Fix #14225: Desync when “allow early scenario completion” is enabled

This commit is contained in:
Michael Steenbeek
2021-03-08 20:16:21 +01:00
committed by GitHub
parent b1a54fa7ba
commit bc2df33b0a
2 changed files with 7 additions and 3 deletions

View File

@@ -288,6 +288,7 @@ static void scenario_day_update()
{
finance_update_daily_profit();
peep_update_days_in_queue();
bool allowEarlyCompletion = gConfigGeneral.allow_early_completion && (network_get_mode() == NETWORK_MODE_NONE);
switch (gScenarioObjective.Type)
{
case OBJECTIVE_10_ROLLERCOASTERS:
@@ -298,7 +299,7 @@ static void scenario_day_update()
scenario_objective_check();
break;
default:
if (gConfigGeneral.allow_early_completion)
if (allowEarlyCompletion)
scenario_objective_check();
break;
}
@@ -712,8 +713,9 @@ ObjectiveStatus Objective::CheckGuestsBy() const
{
int16_t parkRating = gParkRating;
int32_t currentMonthYear = gDateMonthsElapsed;
bool allowEarlyCompletion = gConfigGeneral.allow_early_completion && (network_get_mode() == NETWORK_MODE_NONE);
if (currentMonthYear == MONTH_COUNT * Year || gConfigGeneral.allow_early_completion)
if (currentMonthYear == MONTH_COUNT * Year || allowEarlyCompletion)
{
if (parkRating >= 600 && gNumGuestsInPark >= NumGuests)
{
@@ -733,8 +735,9 @@ ObjectiveStatus Objective::CheckParkValueBy() const
int32_t currentMonthYear = gDateMonthsElapsed;
money32 objectiveParkValue = Currency;
money32 parkValue = gParkValue;
bool allowEarlyCompletion = gConfigGeneral.allow_early_completion && (network_get_mode() == NETWORK_MODE_NONE);
if (currentMonthYear == MONTH_COUNT * Year || gConfigGeneral.allow_early_completion)
if (currentMonthYear == MONTH_COUNT * Year || allowEarlyCompletion)
{
if (parkValue >= objectiveParkValue)
{