diff --git a/About/Manifest.xml b/About/Manifest.xml index 32a46d3..4d0ed3f 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.4.0 + 1.0.4.2 diff --git a/Assemblies/RJW_Menstruation.dll b/Assemblies/RJW_Menstruation.dll index 9322186..98c158d 100644 Binary files a/Assemblies/RJW_Menstruation.dll and b/Assemblies/RJW_Menstruation.dll differ diff --git a/changelogs.txt b/changelogs.txt index b5a8bed..6495492 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,10 +1,14 @@ +Version 1.0.4.2 + - fixed errors on hybrid custom + - fixed errors on pregnancy + Version 1.0.4.1 - fixed errors when the race mods are uninstalled - minor bug fixes - removed mechanoids from hybrid table - increased probability weight range of custom hybrid - breasts size increase gradually after pregnancy about one cup - + Version 1.0.4.0 - minor bug fixes - cums will get maximum thickness initially and become thinner gradually diff --git a/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index c7218e5..cf76acf 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -490,10 +490,10 @@ namespace RJW_Menstruation { PawnKindDef res = null; Pawn opposite = second; - HybridInformations info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == first.def.defName && x.hybridExtension.Exists(y => y.defName == second.def.defName)); + HybridInformations info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == first.def?.defName && (x.hybridExtension?.Exists(y => y.defName == second.def?.defName) ?? false)); if (info == null) { - info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == second.def.defName && x.hybridExtension.Exists(y => y.defName == first.def.defName)); + info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == second.def?.defName && (x.hybridExtension?.Exists(y => y.defName == first.def?.defName) ?? false)); opposite = first; } diff --git a/source/RJW_Menstruation/RJW_Menstruation/Things.cs b/source/RJW_Menstruation/RJW_Menstruation/Things.cs index b25f675..343e57c 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Things.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Things.cs @@ -34,7 +34,7 @@ namespace RJW_Menstruation public class HybridExtension { - public Dictionary hybridInfo; + public Dictionary hybridInfo = new Dictionary(); public ThingDef thingDef; public HybridExtension() { } @@ -60,7 +60,6 @@ namespace RJW_Menstruation public void LoadDataFromXmlCustom(XmlNode xmlRoot) { - hybridInfo = new Dictionary(); DirectXmlCrossRefLoader.RegisterObjectWantsCrossRef(this, "thingDef", xmlRoot.Name); XmlNodeList childNodes = xmlRoot.ChildNodes; diff --git a/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs b/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs index 2339532..a459d03 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_HybridCustom.cs @@ -140,7 +140,7 @@ namespace RJW_Menstruation Rect outRect = new Rect(inRect.x, inRect.y + 30f, inRect.width, inRect.height - 30f); - Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, Math.Max(24f*Configurations.HybridOverride.Count(),10f)); + Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, Math.Max(24f*Configurations.HybridOverride?.Count() ?? 1,10f)); Listing_Standard listmain = new Listing_Standard(); listmain.BeginScrollView(outRect, ref scroll, ref mainRect); @@ -336,12 +336,12 @@ namespace RJW_Menstruation float additionalHeight = 0f; if (!info.hybridExtension.NullOrEmpty()) foreach(HybridExtensionExposable e in info.hybridExtension) { - additionalHeight += e.hybridInfo.Count() * rowH; + additionalHeight += e.hybridInfo?.Count() ?? 1 * rowH; } Rect outRect = new Rect(inRect.x, inRect.y + 30f, inRect.width, inRect.height - 30f); - Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, rowH * info.hybridExtension.Count() + additionalHeight); + Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, rowH * info.hybridExtension?.Count() ?? 1 + additionalHeight); Listing_Standard listmain = new Listing_Standard(); listmain.BeginScrollView(outRect, ref scroll, ref mainRect); @@ -351,7 +351,7 @@ namespace RJW_Menstruation { foreach (HybridExtensionExposable extension in info.hybridExtension) { - DoRow(listmain.GetRect(rowH + rowH * extension.hybridInfo.Count()), extension); + DoRow(listmain.GetRect(rowH + rowH * extension.hybridInfo?.Count() ?? 1), extension); } } diff --git a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index 7d4c605..b136a9c 100644 --- a/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -184,7 +184,8 @@ namespace RJW_Menstruation if (!h.babies.NullOrEmpty()) return h.babies.First(); else { - Log.Error("Baby not exist: baby was not created or removed"); + Log.Error("Baby not exist: baby was not created or removed. Remove pregnancy."); + pawn.health.RemoveHediff(hediff); return null; } }