Skip to content

Commit 75a1e94

Browse files
committed
Revert 776f9b2 (setCameraMatrix no-op)
1 parent dd0b5fb commit 75a1e94

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5078,30 +5078,7 @@ bool CStaticFunctionDefinitions::SetCameraMatrix(const CVector& vecPosition, CVe
50785078
return false;
50795079

50805080
if (!m_pCamera->IsInFixedMode())
5081-
{
5082-
// Some scripts call setCameraMatrix(getCameraMatrix()) while dead to preserve the current frame.
5083-
// Treat this as a no-op so we don't switch into fixed mode and block later spectate target updates.
5084-
CMatrix currentMatrix;
5085-
if (m_pCamera->GetMatrix(currentMatrix))
5086-
{
5087-
const CVector currentLookAt = currentMatrix.vPos + currentMatrix.vFront;
5088-
const CVector requestedLookAt = pvecLookAt ? *pvecLookAt : currentLookAt;
5089-
5090-
constexpr float kCameraNoOpEpsilon = 0.01f;
5091-
const float posDeltaSq = (currentMatrix.vPos - vecPosition).LengthSquared();
5092-
const float lookDeltaSq = (currentLookAt - requestedLookAt).LengthSquared();
5093-
const float epsilonSq = kCameraNoOpEpsilon * kCameraNoOpEpsilon;
5094-
5095-
if (posDeltaSq <= epsilonSq && lookDeltaSq <= epsilonSq)
5096-
{
5097-
if (std::isfinite(fFOV) && fFOV > 0.0f && fFOV < 180.0f)
5098-
m_pCamera->SetFOV(fFOV);
5099-
return true;
5100-
}
5101-
}
5102-
51035081
m_pCamera->ToggleCameraFixedMode(true);
5104-
}
51055082

51065083
// Put the camera there
51075084
m_pCamera->SetPosition(vecPosition);

0 commit comments

Comments
 (0)