diff --git a/Source/IdeologyAddon/IdeologyAddon.csproj b/Source/IdeologyAddon/IdeologyAddon.csproj index 986e3fa..605d066 100644 --- a/Source/IdeologyAddon/IdeologyAddon.csproj +++ b/Source/IdeologyAddon/IdeologyAddon.csproj @@ -94,7 +94,7 @@ - 1.4.3524 + 1.4.3530 2.2.2 diff --git a/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs b/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs index a375f0c..60e1595 100644 --- a/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs +++ b/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs @@ -156,10 +156,11 @@ namespace RJWSexperience.Ideology.Patches } } - [HarmonyPatch(typeof(PawnDesignations_Comfort), nameof(PawnDesignations_Comfort.UpdateCanDesignateComfort))] - public static class RJW_PatchUpdateCanDesignateComfort + [HarmonyPatch(typeof(PawnDesignations_Comfort))] + public static class RJW_Patch_PawnDesignations_Comfort_Submissive { - public static void Postfix(Pawn pawn, ref bool __result) + [HarmonyPostfix, HarmonyPatch(nameof(PawnDesignations_Comfort.UpdateCanDesignateComfort))] + public static void UpdateCanDesignateComfort(Pawn pawn, ref bool __result) { if (pawn.IsSubmissive()) { @@ -167,6 +168,25 @@ namespace RJWSexperience.Ideology.Patches __result = true; } } + + /// + /// RJW undesignates if it thinks that the pawn can't be a comfort pawn. + /// Why the hell checker method changes the state? + /// + /// Pawn to check + /// Is pawn currenlty designated as comfort + /// Run the original method + [HarmonyPrefix, HarmonyPatch(nameof(PawnDesignations_Comfort.IsDesignatedComfort))] + public static bool IsDesignatedComfort(Pawn pawn, ref bool __result) + { + if (pawn.IsSubmissive() && !pawn.Dead) + { + __result = pawn.GetRJWPawnData().Comfort; + return false; + } + + return true; + } } [HarmonyPatch(typeof(Hediff_BasePregnancy), nameof(Hediff_BasePregnancy.PostBirth))]