Jobdriver works until spawning

This commit is contained in:
Vegapnk 2024-07-16 18:34:04 +02:00
parent 1b547094fe
commit d1129fece2
2 changed files with 2 additions and 6 deletions

View file

@ -18,11 +18,9 @@ namespace RJW_Genes
public override void CompPostTick(ref float severityAdjustment)
{
ModLog.Debug("Running HediffComp_ProcessCumbucket CompPostTick");
if (this.Props.mtbDaysPerStage[this.parent.CurStageIndex] > 0f && base.Pawn.IsHashIntervalTick(60) && Rand.MTBEventOccurs(this.Props.mtbDaysPerStage[this.parent.CurStageIndex], 60000f, 60f))
{
ModLog.Debug("Firing HediffComp_ProcessCumbucket CompPostTick");
ModLog.Debug($"Triggered HediffComp_ProcessCumbucket CompPostTick - Starting a JobDriver ProcessCumbucket for {this.parent.pawn}");
this.Pawn.jobs.StartJob(JobMaker.MakeJob(DefDatabase<JobDef>.GetNamed("ProcessCumbucket")), lastJobEndCondition: Verse.AI.JobCondition.InterruptForced, resumeCurJobAfterwards: true);
}
}

View file

@ -22,11 +22,9 @@ namespace RJW_Genes
protected override IEnumerable<Toil> MakeNewToils()
{
if (ModsConfig.IsActive("rjw.sexperience"))
if (!ModsConfig.IsActive("rjw.sexperience"))
yield break;
ModLog.Debug("Starting Toils for Processing Cumbucket");
Toil toil = new Toil();
toil.initAction = delegate ()
{