mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Do not close new campaign window when starting a campaign results in an error, fixes #4810
This commit is contained in:
committed by
Michael Steenbeek
parent
1a20da3dfb
commit
2bb3a297b4
@@ -138,10 +138,16 @@ void marketing_set_guest_campaign(rct_peep *peep, sint32 campaign)
|
||||
}
|
||||
}
|
||||
|
||||
void marketing_start_campaign(sint32 type, sint32 rideOrItem, sint32 numWeeks)
|
||||
bool marketing_start_campaign(sint32 type, sint32 rideOrItem, sint32 numWeeks)
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_START_MARKETING_CAMPAIGN;
|
||||
game_do_command(0, (numWeeks << 8) | GAME_COMMAND_FLAG_APPLY, 0, (rideOrItem << 8) | type, GAME_COMMAND_START_MARKETING_CAMPAIGN, 0, 0);
|
||||
sint32 retVal = game_do_command(0, (numWeeks << 8) | GAME_COMMAND_FLAG_APPLY, 0, (rideOrItem << 8) | type, GAME_COMMAND_START_MARKETING_CAMPAIGN, 0, 0);
|
||||
if (retVal == MONEY32_UNDEFINED) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,7 +47,7 @@ extern uint8 gMarketingCampaignRideIndex[22];
|
||||
sint32 marketing_get_campaign_guest_generation_probability(sint32 campaign);
|
||||
void marketing_update();
|
||||
void marketing_set_guest_campaign(rct_peep *peep, sint32 campaign);
|
||||
void marketing_start_campaign(sint32 type, sint32 rideOrItem, sint32 numWeeks);
|
||||
bool marketing_start_campaign(sint32 type, sint32 rideOrItem, sint32 numWeeks);
|
||||
void game_command_start_campaign(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp);
|
||||
bool marketing_is_campaign_type_applicable(sint32 campaignType);
|
||||
|
||||
|
||||
@@ -225,8 +225,10 @@ static void window_new_campaign_mouseup(rct_window *w, rct_widgetindex widgetInd
|
||||
window_close(w);
|
||||
break;
|
||||
case WIDX_START_BUTTON:
|
||||
marketing_start_campaign(w->campaign.campaign_type, w->campaign.ride_id, w->campaign.no_weeks);
|
||||
window_close(w);
|
||||
if (marketing_start_campaign(w->campaign.campaign_type, w->campaign.ride_id, w->campaign.no_weeks))
|
||||
{
|
||||
window_close(w);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user