Skip to content

Commit 4b4c4c1

Browse files
authored
Fix frozen state rotation return value (#1291) (#4436)
Fix frozen state rotation handling in CClientPed
1 parent 777e6e4 commit 4b4c4c1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,13 @@ void CClientPed::SetFrozen(bool bFrozen)
20142014
if (m_pPlayerPed)
20152015
{
20162016
m_pPlayerPed->GetMatrix(&m_matFrozen);
2017+
2018+
CVector vecFrozenRotation = m_matFrozen.GetRotation();
2019+
2020+
if (vecFrozenRotation.fX == 0.0f && vecFrozenRotation.fY == 0.0f && vecFrozenRotation.fZ == 0.0f)
2021+
{
2022+
m_matFrozen.SetRotation(m_Matrix.GetRotation());
2023+
}
20172024
}
20182025
else
20192026
{
@@ -3326,6 +3333,12 @@ void CClientPed::ApplyControllerStateFixes(CControllerState& Current)
33263333

33273334
float CClientPed::GetCurrentRotation()
33283335
{
3336+
if (IsFrozen())
3337+
{
3338+
CVector vecRotation = m_matFrozen.GetRotation();
3339+
return vecRotation.fZ;
3340+
}
3341+
33293342
if (m_pPlayerPed)
33303343
{
33313344
return m_pPlayerPed->GetCurrentRotation();

0 commit comments

Comments
 (0)