Fix `CCoronas::UpdateCoronaCoors` (#1096)

This commit is contained in:
Pirulax 2025-05-27 22:20:44 +02:00 committed by GitHub
parent 9952a3c8b4
commit 1cf55b4af6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -587,9 +587,10 @@ void CCoronas::RegisterCorona(uint32 id, CEntity* attachTo, uint8 red, uint8 gre
// 0x6FC4D0
void CCoronas::UpdateCoronaCoors(uint32 id, const CVector& posn, float farClip, float angle) {
if (sq(farClip) >= (TheCamera.GetPosition() - posn).SquaredMagnitude2D()) {
auto* corona = GetCoronaByID(id);
corona->m_vPosn = posn;
corona->m_fAngle = angle;
if (auto* const corona = GetCoronaByID(id)) {
corona->m_vPosn = posn;
corona->m_fAngle = angle;
}
}
}