fix LoopNeverending error

This commit is contained in:
Euclidean 2024-02-14 06:57:26 +00:00
parent 33ebba94a7
commit c6241be3fc

View file

@ -4,6 +4,7 @@ using RimWorld;
using rjw; using rjw;
using UnityEngine; using UnityEngine;
using Verse; using Verse;
using Verse.AI;
using Verse.Sound; using Verse.Sound;
namespace Rimworld_Animations { namespace Rimworld_Animations {
@ -513,9 +514,15 @@ namespace Rimworld_Animations {
public bool LoopNeverending() public bool LoopNeverending()
{ {
if(pawn?.jobs?.curDriver != null && JobDriver jobDriver = pawn?.jobs?.curDriver;
(pawn.jobs.curDriver is JobDriver_Sex) && (pawn.jobs.curDriver as JobDriver_Sex).neverendingsex || if (jobDriver == null) return false;
(pawn.jobs.curDriver is JobDriver_SexBaseReciever) && (pawn.jobs.curDriver as JobDriver_Sex).Partner?.jobs?.curDriver != null && ((pawn.jobs.curDriver as JobDriver_Sex).Partner.jobs.curDriver as JobDriver_Sex).neverendingsex)
if (jobDriver is JobDriver_Sex sexDriver && sexDriver.neverendingsex)
{
return true;
}
if (jobDriver is JobDriver_SexBaseReciever sexReceiverDriver && sexReceiverDriver.Partner?.jobs?.curDriver is JobDriver_Sex partnerSexDriver && partnerSexDriver.neverendingsex)
{ {
return true; return true;
} }