diff --git a/CHANGELOG.md b/CHANGELOG.md index 186c315..48efc2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Copy of Infis patch for eating cum from sexperience, #41 and #48 - Updated some Icons to have better backgrounds (thanks @WasmachenDennSachenSo #53) - Custom Queen- and Drone-Xenotypes should work now. +- Some more checks if Queen is on Map or not (fixing #60) *Notes*: The pawns that are gender fluid can get pregnant. diff --git a/Source/Genes/Hive/Helpers/HiveUtility.cs b/Source/Genes/Hive/Helpers/HiveUtility.cs index 03bdf34..089be9c 100644 --- a/Source/Genes/Hive/Helpers/HiveUtility.cs +++ b/Source/Genes/Hive/Helpers/HiveUtility.cs @@ -61,6 +61,9 @@ namespace RJW_Genes /// True if the pawn is on the home-map, False otherwise. public static bool PawnIsOnHomeMap(Pawn pawn) { + if (Find.Maps.NullOrEmpty() || !Find.Maps.Where(mapCandidate => mapCandidate.IsPlayerHome).Any()) { + return false; + } Map homeMap = Find.Maps.Where(mapCandidate => mapCandidate.IsPlayerHome).First(); return homeMap != null && pawn != null