From 45e41a529bbd42388b22dd262f81ea57c369b033 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Wed, 6 Nov 2024 00:02:54 +0800 Subject: [PATCH] [saco] Match `CCamera::GetDistanceFromPoint(...)` --- saco/game/camera.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/saco/game/camera.cpp b/saco/game/camera.cpp index 44eaa07..bb6488b 100644 --- a/saco/game/camera.cpp +++ b/saco/game/camera.cpp @@ -161,16 +161,11 @@ void CCamera::FUNC_1009D6B0() float CCamera::GetDistanceFromPoint(VECTOR *vecPos) { - VECTOR vecCameraPos; - float fSX,fSY,fSZ; + float fSX,fSY,fSZ; - vecCameraPos.X = *(float*)0xB6F9CC; - vecCameraPos.Y = *(float*)0xB6F9D0; - vecCameraPos.Z = *(float*)0xB6F9D4; - - fSX = (vecPos->X - vecCameraPos.X) * (vecPos->X - vecCameraPos.X); - fSY = (vecPos->Y - vecCameraPos.Y) * (vecPos->Y - vecCameraPos.Y); - fSZ = (vecPos->Z - vecCameraPos.Z) * (vecPos->Z - vecCameraPos.Z); + fSX = (vecPos->X - *(float*)0xB6F9CC) * (vecPos->X - *(float*)0xB6F9CC); + fSY = (vecPos->Y - *(float*)0xB6F9D0) * (vecPos->Y - *(float*)0xB6F9D0); + fSZ = (vecPos->Z - *(float*)0xB6F9D4) * (vecPos->Z - *(float*)0xB6F9D4); return (float)sqrt(fSX + fSY + fSZ); }