Skip to content

Commit

Permalink
minor bug fix regarding pawnkind backstories
Browse files Browse the repository at this point in the history
  • Loading branch information
erdelf committed Aug 18, 2018
1 parent 60e5a6f commit e093e9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file modified Assemblies/AlienRace.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions Source/AlienRace/AlienRace/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1844,15 +1844,15 @@ public static bool FillBackstoryInSlotShuffledPrefix(Pawn pawn, BackstorySlot sl
private static PawnBioDef bioReference;

// ReSharper disable once RedundantAssignment
public static void TryGetRandomUnusedSolidBioForPostfix(string backstoryCategory, ref PawnBio __result, PawnKindDef kind, Gender gender, string requiredLastName)
public static void TryGetRandomUnusedSolidBioForPostfix(List<string> backstoryCategories, ref PawnBio __result, PawnKindDef kind, Gender gender, string requiredLastName)
{
if (SolidBioDatabase.allBios.Where(predicate: pb =>
(((kind.race as ThingDef_AlienRace)?.alienRace.generalSettings.allowHumanBios ?? true) && (kind.GetModExtension<Info>()?.allowHumanBios ?? true) ||
(DefDatabase<PawnBioDef>.AllDefs.FirstOrDefault(predicate: pbd => pb.name.ConfusinglySimilarTo(other: pbd.name))?.validRaces.Contains(item: kind.race) ?? false)) &&
(pb.gender == GenderPossibility.Either || pb.gender == GenderPossibility.Male && gender == Gender.Male) &&
(requiredLastName.NullOrEmpty() || pb.name.Last == requiredLastName) &&
(!kind.factionLeader || pb.pirateKing) &&
pb.adulthood.spawnCategories.Contains(item: backstoryCategory) &&
pb.adulthood.spawnCategories.Any(predicate: backstoryCategories.Contains) &&
!pb.name.UsedThisGame).TryRandomElement(result: out PawnBio bio))
{
__result = bio;
Expand Down

0 comments on commit e093e9a

Please sign in to comment.