From 8e471adeec58f63159fc14c4f2a13527a84dfee0 Mon Sep 17 00:00:00 2001 From: Bryan Aldrich Date: Wed, 8 Sep 2021 10:46:26 -0400 Subject: [PATCH] Allow pawns to have no non-emergency jobs enabled. --- .../Worksettings/Pawn_WorkSettings_CacheWorkGiversInOrder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/HarmonyPatches/Worksettings/Pawn_WorkSettings_CacheWorkGiversInOrder.cs b/Source/HarmonyPatches/Worksettings/Pawn_WorkSettings_CacheWorkGiversInOrder.cs index 752571e..319bc2c 100644 --- a/Source/HarmonyPatches/Worksettings/Pawn_WorkSettings_CacheWorkGiversInOrder.cs +++ b/Source/HarmonyPatches/Worksettings/Pawn_WorkSettings_CacheWorkGiversInOrder.cs @@ -59,7 +59,7 @@ public static bool Prefix( Pawn_WorkSettings __instance ) // lowest priority non-emergency job var maxEmergPrio = allWorkgivers .Where( wg => !wg.def.emergency ) - .Min( wg => pawn.GetPriority( wg.def, -1 ) ); + .Min( wg => (int?)pawn.GetPriority( wg.def, -1 ) ) ?? 0; // create lists of workgivers normalWorkgivers = allWorkgivers