Merge branch 'master' into 'master'

Fix LoopNeverending Error

See merge request c0ffeeeeeeee/rimworld-animations!18
This commit is contained in:
c0ffeeeeeeee 2024-02-14 07:26:48 +00:00
commit 15b0e2c9f6

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;
}