fix LoopNeverending error

This commit is contained in:
Euclidean 2024-02-14 06:57:26 +00:00
parent 33ebba94a7
commit c6241be3fc
1 changed files with 10 additions and 3 deletions

View File

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