From dd0a35b15552ee1971262eed5db38c18110b7b42 Mon Sep 17 00:00:00 2001 From: data-bomb Date: Tue, 21 May 2024 16:46:45 -0700 Subject: [PATCH] Patch OneFactionAlreadyEliminated in HQlessHumansLose - Switches to GetHasAnyCritical() method to determine if Human and Alien factions have any critical units/structures remaining --- Si_HQlessHumansLose/Si_HQlessHumansLose.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Si_HQlessHumansLose/Si_HQlessHumansLose.cs b/Si_HQlessHumansLose/Si_HQlessHumansLose.cs index eabb0f8..42f2b79 100644 --- a/Si_HQlessHumansLose/Si_HQlessHumansLose.cs +++ b/Si_HQlessHumansLose/Si_HQlessHumansLose.cs @@ -33,7 +33,7 @@ You should have received a copy of the GNU General Public License using System; using SilicaAdminMod; -[assembly: MelonInfo(typeof(HQlessHumansLose), "HQless Humans Lose", "1.3.4", "databomb", "https://github.com/data-bomb/Silica")] +[assembly: MelonInfo(typeof(HQlessHumansLose), "HQless Humans Lose", "1.3.5", "databomb", "https://github.com/data-bomb/Silica")] [assembly: MelonGame("Bohemia Interactive", "Silica")] [assembly: MelonOptionalDependencies("Admin Mod")] @@ -71,18 +71,22 @@ static String GetRootStructureFullName(Team team) public static bool OneFactionAlreadyEliminated() { - int TeamsWithMajorStructures = 0; + int TeamsWithCriticalObjects = 0; for (int i = 0; i < SiConstants.MaxPlayableTeams; i++) { Team? thisTeam = Team.Teams[i]; - int thisTeamMajorStructures = thisTeam.NumMajorStructures; - if (thisTeamMajorStructures > 0) + if (thisTeam == null) { - TeamsWithMajorStructures++; + continue; + } + + if (thisTeam.GetHasAnyCritical()) + { + TeamsWithCriticalObjects++; } } - if (TeamsWithMajorStructures < 2) + if (TeamsWithCriticalObjects < 2) { MelonLogger.Msg("OneFactionAlreadyEliminated: true"); return true;