mirror of
				https://gitgud.io/amevarashi/rjw-sexperience-ideology.git
				synced 2024-08-15 00:43:19 +00:00 
			
		
		
		
	Fixed #1: Submissive gender can't be marked for comfort
This commit is contained in:
		
							parent
							
								
									36f879e0b6
								
							
						
					
					
						commit
						d483924c47
					
				
					 2 changed files with 24 additions and 4 deletions
				
			
		| 
						 | 
					@ -94,7 +94,7 @@
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <PackageReference Include="Krafs.Rimworld.Ref">
 | 
					    <PackageReference Include="Krafs.Rimworld.Ref">
 | 
				
			||||||
      <Version>1.4.3524</Version>
 | 
					      <Version>1.4.3530</Version>
 | 
				
			||||||
    </PackageReference>
 | 
					    </PackageReference>
 | 
				
			||||||
    <PackageReference Include="Lib.Harmony">
 | 
					    <PackageReference Include="Lib.Harmony">
 | 
				
			||||||
      <Version>2.2.2</Version>
 | 
					      <Version>2.2.2</Version>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -156,10 +156,11 @@ namespace RJWSexperience.Ideology.Patches
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	[HarmonyPatch(typeof(PawnDesignations_Comfort), nameof(PawnDesignations_Comfort.UpdateCanDesignateComfort))]
 | 
						[HarmonyPatch(typeof(PawnDesignations_Comfort))]
 | 
				
			||||||
	public static class RJW_PatchUpdateCanDesignateComfort
 | 
						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())
 | 
								if (pawn.IsSubmissive())
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
| 
						 | 
					@ -167,6 +168,25 @@ namespace RJWSexperience.Ideology.Patches
 | 
				
			||||||
				__result = true;
 | 
									__result = true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/// <summary>
 | 
				
			||||||
 | 
							/// RJW undesignates if it thinks that the pawn can't be a comfort pawn.
 | 
				
			||||||
 | 
							/// Why the hell checker method changes the state?
 | 
				
			||||||
 | 
							/// </summary>
 | 
				
			||||||
 | 
							/// <param name="pawn">Pawn to check</param>
 | 
				
			||||||
 | 
							/// <param name="__result">Is pawn currenlty designated as comfort</param>
 | 
				
			||||||
 | 
							/// <returns>Run the original method</returns>
 | 
				
			||||||
 | 
							[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))]
 | 
						[HarmonyPatch(typeof(Hediff_BasePregnancy), nameof(Hediff_BasePregnancy.PostBirth))]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue