Skip to content

Commit 8f5758b

Browse files
attempt to gracefully catch pawns without worksettings.
1 parent f97bd83 commit 8f5758b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Source/Core/VanillaWorkSettings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public static int GetVanillaPriority( this Pawn pawn, WorkTypeDef worktype )
3434
priority = 0;
3535
Logger.Message( $"Priority requested for a workgiver that did not yet exist for {pawn.Name.ToStringShort}. Did you add mods in an existing game?" );
3636
}
37+
catch ( TargetException ){
38+
priority = 0;
39+
Logger.Message( $"Priority requested for a pawn that did not have worksettings ({pawn.Name.ToStringShort})" );
40+
}
3741
return priority;
3842
}
3943

0 commit comments

Comments
 (0)