using System.Reflection;
using NitroxClient.GameLogic;
using NitroxModel.Helper;
namespace NitroxPatcher.Patches.Dynamic;
///
/// Replace the local time calculations by the real server time.
///
public sealed partial class DayNightCycle_Update_Patch : NitroxPatch, IDynamicPatch
{
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((DayNightCycle t) => t.Update());
public static bool Prefix(DayNightCycle __instance)
{
// Essential part of the Update() method to have it running all of the time and have the local time set to the real server time
__instance.timePassedAsDouble = Resolve().CalculateCurrentTime();
__instance.UpdateAtmosphere();
__instance.UpdateDayNightMessage();
return false;
}
}