Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
CWolfs committed Jun 11, 2021
2 parents 79bbe73 + 310a335 commit 7730be4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Core/MissionControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void SetContract(Contract contract) {

if (AllowMissionControl()) {
Main.Logger.Log($"[MissionControl] Mission Control IS allowed to run. ");
if (IsAnyStoryContract()) Main.Logger.Log($"[MissionControl] Contract is a Story contract {(IsInActiveFlashpointContract()? "and it's being used in a Flashpoint." : "")}");
if (IsAnyStoryContract()) Main.Logger.Log($"[MissionControl] Contract is a Story contract {(IsInActiveFlashpointContract() ? "and it's being used in a Flashpoint." : "")}");
if (IsAnyFlashpointContract()) Main.Logger.Log($"[MissionControl] Contract is a Flashpoint contract.");
Main.Logger.Log($"[MissionControl] Player drop difficulty: '{PlayerLanceDropDifficultyValue}' (Skull value '{PlayerLanceDropSkullRating}')");
Main.Logger.Log($"[MissionControl] Player drop tonnage: '{PlayerLanceDropTonnage}' tons");
Expand Down Expand Up @@ -370,7 +370,7 @@ public bool AreAdditionalLancesAllowed(string teamType) {

if (Main.Settings.AdditionalLanceSettings.Enable) {
bool areLancesAllowed = !Main.Settings.AdditionalLanceSettings.IsTeamDisabled(teamType);
if (areLancesAllowed) areLancesAllowed = (!IsAnyFlashpointContract() && !IsAnyStoryContract())|| (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.AdditionalLanceSettings.EnableForFlashpoints || (IsAnyStoryContract() && Main.Settings.EnableStoryOverrides && Main.Settings.AdditionalLanceSettings.EnableForStory));
if (areLancesAllowed) areLancesAllowed = (!IsAnyFlashpointContract() && !IsAnyStoryContract()) || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.AdditionalLanceSettings.EnableForFlashpoints || (IsAnyStoryContract() && Main.Settings.EnableStoryOverrides && Main.Settings.AdditionalLanceSettings.EnableForStory));
if (areLancesAllowed) areLancesAllowed = Main.Settings.AdditionalLanceSettings.GetValidContractTypes().Contains(CurrentContractType);
if (areLancesAllowed) areLancesAllowed = Main.Settings.AdditionalLanceSettings.DisableWhenMaxTonnage.AreLancesAllowed((int)this.CurrentContract.Override.lanceMaxTonnage);
if (areLancesAllowed) areLancesAllowed = Main.Settings.ActiveAdditionalLances.GetValidContractTypes(teamType).Contains(CurrentContractType);
Expand Down Expand Up @@ -480,6 +480,8 @@ public bool IsAnyFlashpointContract() {
}

public bool IsInActiveFlashpointContract() {
if (IsSkirmish()) return false;

return UnityGameInstance.BattleTechGame.Simulation.ActiveFlashpoint?.ActiveContract.encounterObjectGuid == this.CurrentContract.encounterObjectGuid;
}

Expand Down Expand Up @@ -511,7 +513,7 @@ public bool AllowMissionControl(bool SkipFromSaveCheck = false) {

// Allow for story contracts that have overrides or player lances allowed
if (IsAnyStoryContract() && (Main.Settings.EnableStoryOverrides || Main.Settings.EnableAdditionalPlayerMechsForStory)) return true;

// Allow for flashpoints contracts that manually override flashpoints - even if flashpoint settings are off
if (IsAnyFlashpointContract() && Main.Settings.ActiveContractSettings.Enabled) return true;

Expand Down

0 comments on commit 7730be4

Please sign in to comment.