public static void TryGiveJob(Pawn pawn, Job __result, JobGiver_Binge __instance) { if (!Settings.EdibleBingesEnabled || Find.TickManager.TicksGame - _snapshot < 60) { return; } if (!(__instance is JobGiver_BingeFood)) { return; } if (pawn?.Spawned != true) { return; } if (!__result?.CanBeginNow(pawn) ?? true) { return; } if (__result.def != JobDefOf.Ingest) { return; } Find.TickManager.Pause(); _snapshot = Find.TickManager.TicksGame; }
internal static bool IgnoreForbid(this JobGiver_Binge obj, Pawn pawn) { if (_IgnoreForbid == null) { _IgnoreForbid = typeof(JobGiver_Binge).GetMethod("IgnoreForbid", BindingFlags.Instance | BindingFlags.NonPublic); } return((bool)_IgnoreForbid.Invoke(obj, new object[] { pawn })); }