mirror of
https://gitgud.io/c0ffeeeeeeee/rjw-events.git
synced 2024-08-14 23:57:42 +00:00
Added check for rare null ref exception of partner in large orgies
This commit is contained in:
parent
8b13a27272
commit
d165e0487b
5 changed files with 6 additions and 4 deletions
|
@ -24,6 +24,7 @@ namespace RJW_Events
|
|||
base.setup_ticks();
|
||||
JobDef PartnerJob = DefDatabase<JobDef>.GetNamed("GettinOrgySex", true);
|
||||
this.FailOnDespawnedOrNull(this.iTarget);
|
||||
this.FailOn(() => this.Partner == null);
|
||||
this.FailOn(() => !this.Partner.health.capacities.CanBeAwake);
|
||||
this.FailOn(() => this.pawn.IsFighting());
|
||||
this.FailOn(() => this.Partner.IsFighting());
|
||||
|
@ -53,7 +54,7 @@ namespace RJW_Events
|
|||
initAction = delegate ()
|
||||
{
|
||||
|
||||
if(Partner.CurJob.def != PartnerJob)
|
||||
if(Partner?.jobs != null && Partner?.CurJob?.def != null && Partner.CurJob.def != PartnerJob)
|
||||
{
|
||||
Job newJob = JobMaker.MakeJob(PartnerJob, this.pawn, this.Partner);
|
||||
this.Partner.jobs.StartJob(newJob, JobCondition.InterruptForced, null, false, true, null, null, false, false);
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace RJW_Events
|
|||
this.ticks_between_hearts -= 25;
|
||||
}
|
||||
this.FailOnDespawnedOrNull(this.iTarget);
|
||||
this.FailOn(() => this.Partner == null);
|
||||
this.FailOn(() => !(Partner.jobs.curDriver is JobDriver_Sex));
|
||||
this.FailOn(() => !base.Partner.health.capacities.CanBeAwake);
|
||||
this.FailOn(() => this.pawn.Drafted);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue