mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Patch bug when suiting up inside force volume on initial spawn
This commit is contained in:
parent
7fe2f80b06
commit
d9134a4fd4
@ -0,0 +1,28 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using NewHorizons.Utility.OWMLUtilities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace NewHorizons.Patches.PlayerPatches
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(PlayerCameraController))]
|
||||||
|
public static class PlayerCameraControllerPatches
|
||||||
|
{
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(nameof(PlayerCameraController.SnapToDegreesOverSeconds))]
|
||||||
|
public static bool PlayerCameraController_SnapToDegreesOverSeconds(PlayerCameraController __instance, float targetX, float targetY, float duration, bool smoothStep)
|
||||||
|
{
|
||||||
|
// AlignPlayerWithForce.OnSuitUp snaps the camera to center, but it never unsnaps because duration == 0f
|
||||||
|
if (duration <= 0f)
|
||||||
|
{
|
||||||
|
__instance._degreesX = targetX;
|
||||||
|
__instance._degreesY = targetY;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user