static bool Prefix(ref LordToil_PrepareCaravan_GatherItems __instance) { LordToilTick(__instance); if (Find.TickManager.TicksGame % 120 < RefcellRespeedConfig.currentTimeMultiplier) { return(false); } bool flag = true; for (int index = 0; index < __instance.lord.ownedPawns.Count; ++index) { Pawn ownedPawn = __instance.lord.ownedPawns[index]; if (ownedPawn.IsColonist && ownedPawn.mindState.lastJobTag != JobTag.WaitingForOthersToFinishGatheringItems) { flag = false; break; } } if (flag) { List <Pawn> allPawnsSpawned = __instance.Map.mapPawns.AllPawnsSpawned; for (int index = 0; index < allPawnsSpawned.Count; ++index) { if (allPawnsSpawned[index].CurJob != null && allPawnsSpawned[index].jobs.curDriver is JobDriver_PrepareCaravan_GatherItems && allPawnsSpawned[index].CurJob.lord == __instance.lord) { flag = false; break; } } } if (!flag) { return(false); } __instance.lord.ReceiveMemo("AllItemsGathered"); return(false); }
static void LordToilTick(LordToil_PrepareCaravan_GatherItems instance) { }