Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RA}Evacuation logic enhancements and MP fix #453

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions redalert/aircraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@
*=============================================================================================*/
static bool _Counts_As_Civ_Evac(ObjectClass const* candidate)
{
/*
** If evac logic isn't enabled, no candidate can be evacuated.
*/
if (!Scen.EnableEvac) {
return false;
}

/*
** If the candidate pointer is missing, then return with failure code.
*/
Expand Down
6 changes: 6 additions & 0 deletions redalert/scenario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ ScenarioClass::ScenarioClass(void)
, IsNoMapSel(false)
, IsTruckCrate(false)
, IsMoneyTiberium(false)
, EnableEvac(true)
,
#ifdef FIXIT_VERSION_3 // For endgame auto-sonar pulse.
#define AUTOSONAR_PERIOD TICKS_PER_SECOND * 40
Expand Down Expand Up @@ -782,6 +783,10 @@ void Clear_Scenario(void)
Scen.CarryOverPercent = 0;
Scen.TransitTheme = THEME_NONE;
Scen.Percent = 0;
/*
** Default setting for evac depends on session type.
*/
Scen.EnableEvac = Session.Type == GAME_NORMAL ? true : false;

memset(Scen.GlobalFlags, 0, sizeof(Scen.GlobalFlags));

Expand Down Expand Up @@ -2302,6 +2307,7 @@ bool Read_Scenario_INI(char* fname, bool)
Scen.IsTruckCrate = ini.Get_Bool(BASIC, "TruckCrate", Scen.IsTruckCrate);
Scen.IsMoneyTiberium = ini.Get_Bool(BASIC, "FillSilos", Scen.IsMoneyTiberium);
Scen.Percent = ini.Get_Int(BASIC, "Percent", Scen.Percent);
Scen.EnableEvac = ini.Get_Bool(BASIC, "EnableEvac", Scen.EnableEvac);

/*
** Read in the specific information for each of the house types. This creates
Expand Down
7 changes: 6 additions & 1 deletion redalert/scenario.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class ScenarioClass
unsigned IsToInherit : 1;

/*
** If Tanya or a civilian is to be automatically evacuated when they enter
** If Tanya is to be automatically evacuated when they enter
** a transport vehicle, then this flag will be true.
*/
unsigned IsTanyaEvac : 1;
Expand Down Expand Up @@ -310,6 +310,11 @@ class ScenarioClass
*/
unsigned IsMoneyTiberium : 1;

/*
** When set to false, units will not be evacuated no matter what
*/
unsigned EnableEvac : 1;

/*
** This is the fading countdown timer. As this timer counts down, the
** fading to b&w or color will progress. This timer represents a
Expand Down
Loading