Skip to content

Commit

Permalink
Fixed null throw when other mods play with NPC pilots.
Browse files Browse the repository at this point in the history
  • Loading branch information
donZappo committed Feb 19, 2020
1 parent 995dc69 commit d2c898f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Pilot_Quirks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ public static class Pilot_Died
{
public static void Postfix(SimGameState __instance, Pilot p)
{
if (p == null || !(__instance.PilotRoster.Contains(p) || __instance.Graveyard.Contains(p)))
return;

if (p.pilotDef.PilotTags.Contains("pilot_tech") && !settings.pilot_tech_vanillaTech)
{
__instance.CompanyStats.ModifyStat<int>("SimGame", 0, "MechTechSkill", StatCollection.StatOperation.Int_Subtract, settings.pilot_tech_TechBonus, -1, true);
Expand Down

0 comments on commit d2c898f

Please sign in to comment.