Fix shadows possibly being disabled with zoom patch

This commit is contained in:
D1GQ committed 2026-03-31 16:31:18 -05:00
1 parent d0db486921
commit f88128e6b5
1 file changed
+7 -9
+7 -9
View File
@@ -14,7 +14,7 @@ internal class ZoomPatch
[HarmonyPatch(typeof(HudManager), nameof(HudManager.Update))]
[HarmonyPostfix]
private static void HudManager_Update_Postfix()
private static void HudManager_Update_Postfix(HudManager __instance)
{
// Determine if zooming is allowed:
// - Player can move AND
@@ -51,6 +51,12 @@ internal class ZoomPatch
SetZoomSize(zoomOut: true); // Scroll down = zoom out
}
}
// Show/hide shadow quad based on zoom level and if player is alive
if (__instance.ShadowQuad != null)
{
__instance.ShadowQuad.gameObject.SetActive(Camera.main.orthographicSize == 3.0f && PlayerControl.LocalPlayer.IsAlive());
}
}
// Handles zoom in/out and reset functionality
@@ -76,14 +82,6 @@ internal class ZoomPatch
HudManager.Instance.UICamera.orthographicSize *= size;
}
// Show/hide shadow quad based on zoom level and if player is alive
if (HudManager.Instance.ShadowQuad != null)
{
HudManager.Instance.ShadowQuad.gameObject.SetActive(
(reset || Camera.main.orthographicSize == 3.0f) &&
PlayerControl.LocalPlayer.IsAlive());
}
// Trigger resolution change event if camera size changed
if (Camera.main.orthographicSize != _lastOrthographicSize)
{