From 27bdf1fa2a32b01e4dc3ac50079e92e37c62387f Mon Sep 17 00:00:00 2001 From: Rob Martens Date: Thu, 14 Mar 2024 17:49:47 -0400 Subject: [PATCH] Only force camera yaw in first person There was a reason I originally put this null check outside of the check for first person mode, but I can't remember what it was. Presumably I mistakenly thought that was the solution to some problem that no longer exists. Let's hope so, because doing so broke going through doors in third person. --- src/SHME.ExternalTool/UI/CustomMainForm.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/SHME.ExternalTool/UI/CustomMainForm.cs b/src/SHME.ExternalTool/UI/CustomMainForm.cs index a327526..1d30913 100644 --- a/src/SHME.ExternalTool/UI/CustomMainForm.cs +++ b/src/SHME.ExternalTool/UI/CustomMainForm.cs @@ -284,16 +284,6 @@ public override void UpdateValues(ToolFormUpdateType type) _harryModel = new Ilm(header, remaining); } - if (_forcedCameraYaw != null) - { - _holdCameraPitch = 0; - _holdCameraYaw = Core.DegreesToGameUnits((float)_forcedCameraYaw); - _holdCameraRoll = 0; - HoldCamera(); - - _forcedCameraYaw = null; - } - switch (type) { case ToolFormUpdateType.PreFrame: @@ -332,6 +322,15 @@ public override void UpdateValues(ToolFormUpdateType type) SetButtonNames(); _lastControllerLayoutHash = hash; } + if (_forcedCameraYaw != null) + { + _holdCameraPitch = 0; + _holdCameraYaw = Core.DegreesToGameUnits((float)_forcedCameraYaw); + _holdCameraRoll = 0; + HoldCamera(); + + _forcedCameraYaw = null; + } MoveCameraFirstPerson(); AimCamera(BtnCameraFps); Mem.WriteU16(Rom.Addresses.MainRam.HarryYaw, _holdCameraYaw);