diff --git a/Assemblies/RJW-Events.dll b/Assemblies/RJW-Events.dll
index fac724e..ce48f3f 100644
Binary files a/Assemblies/RJW-Events.dll and b/Assemblies/RJW-Events.dll differ
diff --git a/Defs/DutyDefs/DutyDefs_Sex.xml b/Defs/DutyDefs/DutyDefs_Sex.xml
index b2219b1..c6048b3 100644
--- a/Defs/DutyDefs/DutyDefs_Sex.xml
+++ b/Defs/DutyDefs/DutyDefs_Sex.xml
@@ -19,7 +19,7 @@
- 0.45
+ 0.40
diff --git a/Defs/GatheringDefs/Gatherings_Sex.xml b/Defs/GatheringDefs/Gatherings_Sex.xml
index a344ed3..d560fd2 100644
--- a/Defs/GatheringDefs/Gatherings_Sex.xml
+++ b/Defs/GatheringDefs/Gatherings_Sex.xml
@@ -9,7 +9,7 @@
The orgy has been called off.
The orgy has finished.
Orgy
- GatheringWorker_Party
+ RJW_Events.GatheringWorker_Orgy
PartySpot
diff --git a/Source/JobDrivers/JobDriver_OrgySex.cs b/Source/JobDrivers/JobDriver_OrgySex.cs
index e6b8c73..95ddeb1 100644
--- a/Source/JobDrivers/JobDriver_OrgySex.cs
+++ b/Source/JobDrivers/JobDriver_OrgySex.cs
@@ -63,7 +63,7 @@ namespace RJW_Events
};
Toil toil = new Toil();
toil.defaultCompleteMode = ToilCompleteMode.Never;
- toil.socialMode = RandomSocialMode.Off;
+ toil.socialMode = RandomSocialMode.Normal;
toil.defaultDuration = this.duration;
toil.handlingFacing = true;
toil.FailOn(() => this.Partner.CurJob.def != PartnerJob);
diff --git a/Source/JobDrivers/JobDriver_OrgySexReceiver.cs b/Source/JobDrivers/JobDriver_OrgySexReceiver.cs
index 6ee70fc..f8eb63d 100644
--- a/Source/JobDrivers/JobDriver_OrgySexReceiver.cs
+++ b/Source/JobDrivers/JobDriver_OrgySexReceiver.cs
@@ -54,7 +54,7 @@ namespace RJW_Events
{
Toil toil = new Toil();
toil.defaultCompleteMode = ToilCompleteMode.Never;
- toil.socialMode = RandomSocialMode.Off;
+ toil.socialMode = RandomSocialMode.Normal;
toil.handlingFacing = true;
toil.tickAction = delegate ()
{
diff --git a/Source/LordJobs/LordJob_Joinable_Orgy.cs b/Source/LordJobs/LordJob_Joinable_Orgy.cs
index 567c155..34630d0 100644
--- a/Source/LordJobs/LordJob_Joinable_Orgy.cs
+++ b/Source/LordJobs/LordJob_Joinable_Orgy.cs
@@ -50,15 +50,15 @@ namespace RJW_Events
public override float VoluntaryJoinPriorityFor(Pawn p)
{
- if (!CasualSex_Helper.CanHaveSex(p) || p.Map.mapPawns.FreeColonists.Exists((Pawn p1) =>
- {
-
- return p.relations.SecondaryRomanceChanceFactor(p1) > 0 || p1.relations.SecondaryRomanceChanceFactor(p) > 0;
-
- })) return 0;
+ if (!CasualSex_Helper.CanHaveSex(p)) return 0;
return base.VoluntaryJoinPriorityFor(p);
}
+ public bool IsGatheringAboutToEnd()
+ {
+ return timeoutTrigger.TicksLeft < 300;
+ }
+
}
}
diff --git a/Source/Patches/HarmonyPatch_ReclotheOnEnd.cs b/Source/Patches/HarmonyPatch_ReclotheOnEnd.cs
index 4b0f197..8dc1ddd 100644
--- a/Source/Patches/HarmonyPatch_ReclotheOnEnd.cs
+++ b/Source/Patches/HarmonyPatch_ReclotheOnEnd.cs
@@ -15,9 +15,9 @@ namespace RJW_Events
public static void Postfix(LordToil_Party toil)
{
List ownedPawns = toil.lord.ownedPawns;
- foreach(Pawn p in ownedPawns)
+ for (int i = 0; i < ownedPawns.Count; i++)
{
- p.Drawer.renderer.graphics.ResolveApparelGraphics();
+ ownedPawns[i].Drawer.renderer.graphics.ResolveApparelGraphics();
}
}
}
diff --git a/Source/Patches/HarmonyPatch_StayNudeForOrgy.cs b/Source/Patches/HarmonyPatch_StayNudeForOrgy.cs
index 10c8196..4090c21 100644
--- a/Source/Patches/HarmonyPatch_StayNudeForOrgy.cs
+++ b/Source/Patches/HarmonyPatch_StayNudeForOrgy.cs
@@ -14,7 +14,9 @@ namespace RJW_Events
{
public static bool Prefix(PawnGraphicSet __instance)
{
- if(LordUtility.GetLord(__instance.pawn)?.LordJob != null && LordUtility.GetLord(__instance.pawn).LordJob is LordJob_Joinable_Orgy)
+ if(LordUtility.GetLord(__instance.pawn)?.LordJob != null &&
+ LordUtility.GetLord(__instance.pawn).LordJob is LordJob_Joinable_Orgy &&
+ !(LordUtility.GetLord(__instance.pawn).LordJob as LordJob_Joinable_Orgy).IsGatheringAboutToEnd())
{
return false;
}