Skip to content

Instantly share code, notes, and snippets.

@MustaphaTR
Last active January 29, 2019 11:31
Show Gist options
  • Save MustaphaTR/7290550da7b9a968c123859bcb1c3fa1 to your computer and use it in GitHub Desktop.
Save MustaphaTR/7290550da7b9a968c123859bcb1c3fa1 to your computer and use it in GitHub Desktop.
Doesn't work:
// If all valid weapons have depleted their ammo and Rearmable trait exists, return to RearmActor
if (rearmable != null && attackAircraft.Armaments.All(x => x.IsTraitPaused || !x.Weapon.IsValidAgainst(target, self.World, self)))
return new ReturnToBase(self, aircraft.Info.AbortOnResupply);
Works:
// If all valid weapons have depleted their ammo and Rearmable trait exists, return to RearmActor to reload and then resume the activity
if (rearmable != null && attackAircraft.Armaments.All(x => x.IsTraitPaused || !x.Weapon.IsValidAgainst(target, self.World, self)))
{
self.QueueActivity(new ReturnToBase(self, aircraft.Info.AbortOnResupply));
return NextActivity;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment