diff --git a/1.3/Assemblies/RJW_Menstruation.dll b/1.3/Assemblies/RJW_Menstruation.dll index 05a0aa8..690de3d 100644 Binary files a/1.3/Assemblies/RJW_Menstruation.dll and b/1.3/Assemblies/RJW_Menstruation.dll differ diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs index 7fc21d3..37bc2d3 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs @@ -196,15 +196,16 @@ namespace RJW_Menstruation public static IEnumerable Transpiler(IEnumerable instructions) { // We only want the first fuckability check, i.e. the estrus-haver towards a partner - bool found_fuckability = false; + bool first_fuckability = true; foreach(CodeInstruction instruction in instructions) { - if(!found_fuckability && instruction.LoadsField(MinimumFuckabilityToHookup)) + if(instruction.LoadsField(MinimumFuckabilityToHookup)) { - found_fuckability = true; - yield return new CodeInstruction(OpCodes.Ldarg_0); - yield return new CodeInstruction(OpCodes.Ldarg_1); + yield return new CodeInstruction(first_fuckability ? OpCodes.Ldarg_0 : OpCodes.Ldarg_1); + yield return new CodeInstruction(first_fuckability ? OpCodes.Ldarg_1 : OpCodes.Ldarg_0); + yield return CodeInstruction.Call(typeof(Roll_To_Skip_Patch), nameof(FuckabilityThreshold)); + first_fuckability = false; } else yield return instruction; } @@ -231,8 +232,8 @@ namespace RJW_Menstruation { LocalBuilder pawn_index = null; // Like in the last one, we're only interested in the first of each - bool found_first_attractiveness = false; - bool found_first_relationship = false; + bool first_attractiveness = true; + bool first_relationship = true; foreach(CodeInstruction instruction in instructions) { // Get where the compiler decided to index the pawn at @@ -241,23 +242,27 @@ namespace RJW_Menstruation pawn_index = (LocalBuilder)instruction.operand; yield return instruction; } - else if (!found_first_attractiveness && instruction.LoadsField(MinimumAttractivenessToHookup)) + else if (instruction.LoadsField(MinimumAttractivenessToHookup)) { if (pawn_index?.LocalType != typeof(Pawn)) throw new System.InvalidOperationException($"pawn_index is not a Pawn ({pawn_index?.LocalType})"); - found_first_attractiveness = true; - yield return new CodeInstruction(OpCodes.Ldarg_0); - yield return new CodeInstruction(OpCodes.Ldloc_S, pawn_index); + + yield return first_attractiveness ? new CodeInstruction(OpCodes.Ldarg_0) : new CodeInstruction(OpCodes.Ldloc_S, pawn_index); + yield return first_attractiveness ? new CodeInstruction(OpCodes.Ldloc_S, pawn_index) : new CodeInstruction(OpCodes.Ldarg_0); + yield return CodeInstruction.Call(typeof(FindBestPartner_Patch), nameof(AttractivenessThreshold)); - } - else if (!found_first_relationship && instruction.LoadsField(MinimumRelationshipToHookup)) + first_attractiveness = false; + } + else if (instruction.LoadsField(MinimumRelationshipToHookup)) { if (pawn_index?.LocalType != typeof(Pawn)) throw new System.InvalidOperationException($"pawn_index is not a Pawn ({pawn_index?.LocalType})"); - found_first_relationship = true; - yield return new CodeInstruction(OpCodes.Ldarg_0); - yield return new CodeInstruction(OpCodes.Ldloc_S, pawn_index); + + yield return first_relationship ? new CodeInstruction(OpCodes.Ldarg_0) : new CodeInstruction(OpCodes.Ldloc_S, pawn_index); + yield return first_relationship ? new CodeInstruction(OpCodes.Ldloc_S, pawn_index) : new CodeInstruction(OpCodes.Ldarg_0); + yield return CodeInstruction.Call(typeof(FindBestPartner_Patch), nameof(RelationshipThreshold)); + first_relationship = false; } else yield return instruction; } diff --git a/changelogs.txt b/changelogs.txt index bd35d4c..4339d3d 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -2,6 +2,7 @@ Version 1.0.6.3 - Fix pawn generation for races with a single lifestage. - Show womb gizmo for males with vaginas, too. - Show the status button in the health tab for pawns with more than one genital. + - The hookup override will now apply for pawns in estrus being considered by others. Version 1.0.6.2 - Fix error/crash when a pawn in estrus (with hookup override enabled) looks for partners.