Skip to content

Commit

Permalink
remove destroyed checks from salvage fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Denadan committed Mar 30, 2019
1 parent 161d12e commit 6af3f12
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions source/Patches/Contract_GenerateSalvage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ public static bool GenerateSalvage(List<UnitResult> enemyMechs, List<VehicleDef>
{
var mech = lostUnits[i].mech;

if (!lostUnits[i].pilot.IsIncapacitated && !mech.IsDestroyed && !mech.Inventory.Any(cref =>
cref.Def != null && cref.Def.CriticalComponent &&
cref.DamageLevel == ComponentDamageLevel.Destroyed))
{
Control.LogDebug(DType.SalvageProccess, $"-- Salvaging {mech.Name}");
Control.LogDebug(DType.SalvageProccess, "--- not destroyed - skipped");
lostUnits[i].mechLost = false;
continue;
}

if (Control.Settings.OverrideRecoveryChance)
{
Expand Down Expand Up @@ -172,17 +163,7 @@ public static bool GenerateSalvage(List<UnitResult> enemyMechs, List<VehicleDef>
Control.LogDebug(DType.SalvageProccess, $"- Enemy Mechs {__instance.Name}");
foreach (var unit in enemyMechs)
{
if (unit.pilot.IsIncapacitated || unit.mech.IsDestroyed || unit.mech.Inventory.Any(cref =>
cref.Def != null && cref.Def.CriticalComponent &&
cref.DamageLevel == ComponentDamageLevel.Destroyed))
{
AddMechToSalvage(unit.mech, Contract, simgame, Constants, ___finalPotentialSalvage);
}
else
{
Control.LogDebug(DType.SalvageProccess, $"-- Salvaging {unit.mech.Name}");
Control.LogDebug(DType.SalvageProccess, "--- not destroyed - skipped");
}
AddMechToSalvage(unit.mech, Contract, simgame, Constants, ___finalPotentialSalvage);
}

Control.LogDebug(DType.SalvageProccess, $"- Enemy Vechicle {__instance.Name}");
Expand Down

0 comments on commit 6af3f12

Please sign in to comment.