Fix issue where sunrise/set is not applied for negative values
This commit is contained in:
@@ -540,9 +540,6 @@ namespace InfectionFreeZone {
|
|||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(TimeController), "GetSunsetHour")]
|
[HarmonyPatch(typeof(TimeController), "GetSunsetHour")]
|
||||||
public static void PostfixGetSunsetHour(ref float __result) {
|
public static void PostfixGetSunsetHour(ref float __result) {
|
||||||
if (Main.sunsetHourOffset.Value <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
__result += Main.sunsetHourOffset.Value;
|
__result += Main.sunsetHourOffset.Value;
|
||||||
__result = Mathf.Clamp(__result, 0f, 24f);
|
__result = Mathf.Clamp(__result, 0f, 24f);
|
||||||
}
|
}
|
||||||
@@ -550,9 +547,6 @@ namespace InfectionFreeZone {
|
|||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(TimeController), "GetSunriseHour")]
|
[HarmonyPatch(typeof(TimeController), "GetSunriseHour")]
|
||||||
public static void PostfixGetSunriseHour(ref float __result) {
|
public static void PostfixGetSunriseHour(ref float __result) {
|
||||||
if (Main.sunriseHourOffset.Value <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
__result += Main.sunriseHourOffset.Value;
|
__result += Main.sunriseHourOffset.Value;
|
||||||
__result = Mathf.Clamp(__result, 0f, 24f);
|
__result = Mathf.Clamp(__result, 0f, 24f);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user