This commit is contained in:
2025-08-14 10:11:23 +08:00
parent 31254ef452
commit bb305a4fc2
6 changed files with 200 additions and 67 deletions

View File

@@ -19,6 +19,7 @@ namespace WulaFallenEmpire
protected override IEnumerable<Toil> MakeNewToils()
{
Log.Warning($"[WulaPodDebug] JobDriver_EnterMaintenancePod started for pawn: {pawn.LabelShortCap}");
this.FailOnDespawnedNullOrForbidden(PodIndex);
this.FailOnBurningImmobile(PodIndex);
@@ -26,17 +27,21 @@ namespace WulaFallenEmpire
this.FailOn(() => podComp == null || podComp.State != MaintenancePodState.Idle || !podComp.PowerOn);
// Go to the pod's interaction cell
yield return Toils_Goto.GotoThing(PodIndex, PathEndMode.InteractionCell);
Toil goToPod = Toils_Goto.GotoThing(PodIndex, PathEndMode.InteractionCell);
goToPod.AddPreInitAction(() => Log.Warning($"[WulaPodDebug] EnterJob: Pawn {pawn.LabelShortCap} is going to the pod."));
yield return goToPod;
// Enter the pod
yield return new Toil
Toil enterToil = new Toil
{
initAction = () =>
{
Log.Warning($"[WulaPodDebug] EnterJob: Pawn {pawn.LabelShortCap} has arrived and is entering the pod.");
podComp.StartCycle(pawn);
},
defaultCompleteMode = ToilCompleteMode.Instant
};
yield return enterToil;
}
}
}