Skip to content

Commit

Permalink
Check the scenario name for either "GDI" or "NOD" when choosing the l…
Browse files Browse the repository at this point in the history
…oading screen when playing the campaign.
  • Loading branch information
CCHyper committed Aug 17, 2023
1 parent 0c30825 commit bd43caa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/extensions/scenario/scenarioext_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,23 @@ static void Init_Loading_Screen(const char *filename)
}

/**
* For the campaign, we abuse the required CD to get the desired Side.
* For the campaign, we check to see if the scenario name contains either
* "GDI" or "NOD", and then set the side to those respectively.
*/
SideType side = SIDE_GDI;
if (Session.Type == GAME_NORMAL) {

if (Scen->CampaignID != CAMPAIGN_NONE) {
side = SideType(Campaigns[Scen->CampaignID]->WhichCD);

const char *scen_name = Campaigns[Scen->CampaignID]->Scenario;

if (std::strstr(scen_name, "GDI")) {
side = SIDE_GDI;

} else if (std::strstr(scen_name, "NOD")) {
side = SIDE_NOD;
}

}

/**
Expand Down

0 comments on commit bd43caa

Please sign in to comment.