Added some nullchecks for queen existance, fixing #60

This commit is contained in:
Vegapnk 2023-09-13 16:55:01 +02:00
parent 70a15dbfed
commit 3db05a8dce
2 changed files with 4 additions and 0 deletions

View File

@ -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.

View File

@ -61,6 +61,9 @@ namespace RJW_Genes
/// <returns>True if the pawn is on the home-map, False otherwise.</returns>
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