sumghai / MedPod

Advanced regenerative medical beds for RimWorld
Other
14 stars 15 forks source link

Circadian Half-Cycler from Royalty DLC prevents pawns from using MedPods #38

Closed sumghai closed 3 years ago

sumghai commented 3 years ago

Steam Workshop user Nick reported that the Circadian Half-Cycler from the Royalty DLC causes pawns trying to use the MedPod to get stuck in a loop of getting in and out of the bed, without being healed.

The issue only appears from v1.1.2 onwards, so it is likely that the "gain rest" feature introduced from that update onwards is conflicting with the Half-Cycler.

lunainvictum commented 3 years ago

in fact, this is correct.

Every Pawn with the HalfCycler installed, cant use the Medpod. Following Error pop ups:

Exception in JobDriver tick for pawn Shad driver=JobDriver_LayDown (toilIndex=2) driver.job=(LayDown (Job_10531135) A=Thing_MedPodStandard1458542)
System.NullReferenceException: Object reference not set to an instance of an object
  at MedPod.MedPodMod+Toils_LayDown_LayDown_StayLyingInMedPod.Prefix (Verse.AI.Toil ___layDown, Verse.AI.TargetIndex ___bedOrRestSpotIndex) [0x000ab] in <f0a190cf8a714c0490ceaa904087c4f4>:0 
  at (wrapper dynamic-method) RimWorld.Toils_LayDown+<>c__DisplayClass2_0.RimWorld.Toils_LayDown+c__DisplayClass2_0.<LayDown>b__1_Patch1(RimWorld.Toils_LayDown/<>c__DisplayClass2_0)
  at (wrapper dynamic-method) Verse.AI.JobDriver.Verse.AI.JobDriver.DriverTick_Patch1(Verse.AI.JobDriver)
Verse.Log:Error(String, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver)
Verse.AI.JobDriver:Verse.AI.JobDriver.DriverTick_Patch1(JobDriver)
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Verse.Pawn.Tick_Patch0(Pawn)
Verse.TickList:Verse.TickList.Tick_Patch0(TickList)
Verse.TickManager:Verse.TickManager.DoSingleTick_Patch0(TickManager)
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Verse.Root_Play.Update_Patch0(Root_Play)

It would be great to get this bug fixed, because every pawn (from 50+) on my savegame has this halfcycler installed :)

I am able to give you so much information you need.

A possible "fix" or workaround would be to make the normal medicbed a requirement, and first let the halfcycler remove, then to use the medpod, and than to install the halfcycler back because the halfcycler isnt lost if removed. This could be automated.

Dont know how it is possible to programm this.

sumghai commented 3 years ago

Fixed and tested OK on my end.