diff --git a/1.3/Assemblies/RJW_Menstruation.dll b/1.3/Assemblies/RJW_Menstruation.dll index 01f25cb..bb410bf 100644 Binary files a/1.3/Assemblies/RJW_Menstruation.dll and b/1.3/Assemblies/RJW_Menstruation.dll differ diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index 0383fa1..134e7b0 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -492,7 +492,7 @@ namespace RJW_Menstruation string MotherRaceName = ""; string FatherRaceName = ""; MotherRaceName = mother.kindDef?.race?.defName; - PawnKindDef tmp = spawn_kind_def; + PawnKindDef non_hybrid_kind_def = spawn_kind_def; if (father != null) FatherRaceName = father.kindDef?.race?.defName; @@ -507,7 +507,7 @@ namespace RJW_Menstruation { if (!Configurations.UseHybridExtention || spawn_kind_def == null) { - spawn_kind_def = tmp; + spawn_kind_def = non_hybrid_kind_def; var groups = DefDatabase.AllDefs.Where(x => !(x.hybridRaceParents.NullOrEmpty() || x.hybridChildKindDef.NullOrEmpty())); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Things.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Things.cs index f952be8..77dbbd2 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Things.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Things.cs @@ -50,9 +50,13 @@ namespace RJW_Menstruation { string key = hybridInfo.RandomElementByWeight(x => x.Value).Key; res = DefDatabase.GetNamedSilentFail(key); - if (res == null) res = DefDatabase.GetNamedSilentFail(key).race.AnyPawnKind; + if (res == null) res = DefDatabase.GetNamedSilentFail(key)?.race?.AnyPawnKind; - if (res == null) hybridInfo.Remove(key); + if (res == null) + { + Log.Warning($"Could not find pawnKind or race {key}, removing hybrid definition"); + hybridInfo.Remove(key); + } } while (res == null && !hybridInfo.EnumerableNullOrEmpty()); return res;