diff --git a/Source/Client/AsyncTime/SetMapTime.cs b/Source/Client/AsyncTime/SetMapTime.cs index 91c706b7..66770057 100644 --- a/Source/Client/AsyncTime/SetMapTime.cs +++ b/Source/Client/AsyncTime/SetMapTime.cs @@ -163,6 +163,18 @@ static void Prefix(ref Func textGetter) } } + [HarmonyPatch(typeof(CompCauseGameCondition), nameof(CompCauseGameCondition.EnforceConditionOn))] + static class MapConditionCauserMapTime + { + static void Prefix(Map map, ref TimeSnapshot? __state) + { + if (Multiplayer.Client == null) return; + __state = TimeSnapshot.GetAndSetFromMap(map); + } + + static void Finalizer(TimeSnapshot? __state) => __state?.Set(); + } + public struct TimeSnapshot { public int ticks;