mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Added some nullchecks for queen existance, fixing #60
This commit is contained in:
parent
70a15dbfed
commit
3db05a8dce
2 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue