Bugfix for work types that pawns are incapable of getting reset when reloading a save
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -17,8 +17,9 @@ public class DisabledWorkTypesOptimization : ClassWithFishPatches
|
|||||||
= AccessTools.Method(typeof(Pawn), nameof(Pawn.GetDisabledWorkTypes));
|
= AccessTools.Method(typeof(Pawn), nameof(Pawn.GetDisabledWorkTypes));
|
||||||
|
|
||||||
[HarmonyPriority(Priority.VeryLow)]
|
[HarmonyPriority(Priority.VeryLow)]
|
||||||
public static bool Prefix(Pawn __instance, bool permanentOnly, out List<WorkTypeDef> __result)
|
public static bool Prefix(Pawn __instance, bool permanentOnly, ref List<WorkTypeDef> __result)
|
||||||
=> (__result = permanentOnly
|
=> Current.programStateInt != ProgramState.Playing
|
||||||
|
|| (__result = permanentOnly
|
||||||
? __instance.cachedDisabledWorkTypesPermanent
|
? __instance.cachedDisabledWorkTypesPermanent
|
||||||
: __instance.cachedDisabledWorkTypes) is null;
|
: __instance.cachedDisabledWorkTypes) is null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user