static void Prefix(PawnRenderer __instance, ref TimeSnapshot?__state) { if (Multiplayer.Client == null || Current.ProgramState != ProgramState.Playing) { return; } __state = TimeSnapshot.GetAndSetFromMap(__instance.pawn.MapHeld); }
static void Prefix(ref TimeSnapshot?__state) { if (Multiplayer.Client == null || WorldRendererUtility.WorldRenderedNow || Find.CurrentMap == null) { return; } __state = TimeSnapshot.GetAndSetFromMap(Find.CurrentMap); }
static void Prefix(Map __instance, ref TimeSnapshot?__state) { if (Multiplayer.Client == null) { return; } __state = TimeSnapshot.GetAndSetFromMap(__instance); }
static void Prefix(Sample __instance, ref TimeSnapshot?__state) { if (Multiplayer.game == null) { return; } __state = TimeSnapshot.GetAndSetFromMap(__instance.Map); }
static void Prefix(Sustainer __instance, ref TimeSnapshot?__state) { if (Multiplayer.Client == null) { return; } __state = TimeSnapshot.GetAndSetFromMap(__instance.info.Maker.Map); }
static void Prefix(int ___tile, ref TimeSnapshot?__state) { if (Multiplayer.Client == null) { return; } Map map = Current.Game.FindMap(___tile); if (map == null) { return; } __state = TimeSnapshot.GetAndSetFromMap(map); }
public static TimeSnapshot?GetAndSetFromMap(Map map) { if (map == null) { return(null); } TimeSnapshot prev = Current(); var man = Find.TickManager; var comp = map.AsyncTime(); man.ticksGameInt = comp.mapTicks; man.slower = comp.slower; man.CurTimeSpeed = comp.TimeSpeed; return(prev); }
static void Prefix(ref Func <string> textGetter) { if (Multiplayer.game == null) { return; } var current = TimeSnapshot.Current(); var getter = textGetter; textGetter = () => { var prev = TimeSnapshot.Current(); current.Set(); string s = getter(); prev.Set(); return(s); }; }