From ad931516a52989c9bbe401fa17641d88e9f6f5dc Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Tue, 4 Oct 2022 17:09:01 +0300 Subject: [PATCH] CPlayerState: match GetActiveVisor and GetIsVisorTransitioning --- src/MetroidPrime/Player/CPlayerState.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MetroidPrime/Player/CPlayerState.cpp b/src/MetroidPrime/Player/CPlayerState.cpp index 792963eb..15a2eb3c 100644 --- a/src/MetroidPrime/Player/CPlayerState.cpp +++ b/src/MetroidPrime/Player/CPlayerState.cpp @@ -1,6 +1,10 @@ #include "MetroidPrime/Player/CPlayerState.hpp" +#include "MetroidPrime/TCastTo.hpp" #include "MetroidPrime/CMemoryCard.hpp" +#include "MetroidPrime/CStateManager.hpp" +#include "MetroidPrime/Cameras/CCameraManager.hpp" +#include "MetroidPrime/Cameras/CGameCamera.hpp" #include "Kyoto/Math/CMath.hpp" #include "Kyoto/Streams/CInputStream.hpp" @@ -336,7 +340,7 @@ void CPlayerState::UpdateVisorTransition(float dt) { float CPlayerState::GetVisorTransitionFactor() const { return x1c_visorTransitionFactor / kMaxVisorTransitionFactor; } bool CPlayerState::GetIsVisorTransitioning() const { - return x14_currentVisor != x18_transitioningVisor || x1c_visorTransitionFactor < kMaxVisorTransitionFactor; + return x14_currentVisor != x18_transitioningVisor || kMaxVisorTransitionFactor > x1c_visorTransitionFactor; } float CPlayerState::GetBaseHealthCapacity() { return kBaseHealthCapacity; } @@ -381,9 +385,7 @@ void CPlayerState::UpdateStaticInterference(CStateManager& stateMgr, const float } CPlayerState::EPlayerVisor CPlayerState::GetActiveVisor(const CStateManager& stateMgr) const { - void* cam = NULL; - // const CFirstPersonCamera* cam = - // TCastToConstPtr(stateMgr.GetCameraManager()->GetCurrentCamera(stateMgr)).GetPtr(); + const CFirstPersonCamera* cam = TCastToConstPtr(*stateMgr.GetCameraManager()->GetCurrentCamera(stateMgr)); return (cam ? x14_currentVisor : kPV_Combat); }