protected override IEnumerable <Toil> MakeNewToils() { //Clean up any spare blueprints AddFinishAction(delegate { Blueprint blueprint = TargetB.Thing as Blueprint; if (!blueprint?.Destroyed ?? false) { Log.Message($"Cleaning up {blueprint}"); blueprint.Destroy(DestroyMode.Vanish); } }); job.count = 1; Thing bedroll = pawn.CurJob.targetA.Thing; if (bedroll.Spawned) { Log.Message($"{pawn} needs to pick up {bedroll}"); yield return(Toils_Reserve.Reserve(TargetIndex.A)); yield return(Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.Touch)); yield return(Toils_Haul.TakeToInventory(TargetIndex.A, 1)); } yield return(Toils_Misc.TakeItemFromInventoryToCarrier(pawn, TargetIndex.A)); yield return(Toils_Haul.CarryHauledThingToContainer()); yield return(Toils_Construct.MakeSolidThingFromBlueprintIfNecessary(TargetIndex.B, TargetIndex.C)); //yield return Toils_Haul.DepositHauledThingInContainer(TargetIndex.B, TargetIndex.C);//1.0 game destroys minified thing, but its job still does Deposit? Toil restInBed = new Toil(); restInBed.initAction = delegate { Pawn pawn = restInBed.actor; Job curJob = pawn.jobs.curJob; Building_Bed bed = curJob.targetB.Thing as Building_Bed; pawn.Map.GetComponent <PlacedBedsMapComponent>().placedBeds[pawn] = bed; pawn.ownership?.ClaimBedIfNonMedical(bed); Job restJob = new Job(RimWorld.JobDefOf.LayDown, TargetB); pawn.jobs.StartJob(restJob, JobCondition.Succeeded); }; yield return(restInBed); }