Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Client/mods/deathmatch/logic/CClientCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,10 @@ void CClientCamera::SetFocusToLocalPlayerImpl()
m_pCamera->RestoreWithJumpCut();
SetCenterOfWorldCached(NULL, 0.0f);
InvalidateCachedTransforms();

CClientPlayer* pLocalPlayer = m_pPlayerManager ? m_pPlayerManager->GetLocalPlayer() : nullptr;
if (pLocalPlayer && !pLocalPlayer->GetOccupiedVehicle())
pLocalPlayer->SetCameraRotation(pLocalPlayer->GetCurrentRotation());
}

void CClientCamera::UnreferenceEntity(CClientEntity* pEntity)
Expand Down
7 changes: 7 additions & 0 deletions Client/mods/deathmatch/logic/CClientPed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3376,6 +3376,13 @@ void CClientPed::SetCurrentRotation(float fRotation, bool bIncludeTarget)
CVector vecRotation = m_Matrix.GetRotation();
vecRotation.fZ = fRotation;
m_Matrix.SetRotation(vecRotation);

if (IsFrozen() && !GetRealOccupiedVehicle())
{
CVector vecFrozenRot = m_matFrozen.GetRotation();
vecFrozenRot.fZ = fRotation;
m_matFrozen.SetRotation(vecFrozenRot);
}
}

void CClientPed::SetTargetRotation(float fRotation)
Expand Down
2 changes: 2 additions & 0 deletions Client/mods/deathmatch/logic/rpc/CPedRPCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ void CPedRPCs::SetPedRotation(CClientEntity* pSource, NetBitStreamInterface& bit

if (!IS_PLAYER(pPed))
pPed->SetCameraRotation(rotation.data.fRotation);
else if (pPed->IsLocalPlayer() && m_pCamera && !m_pCamera->IsInFixedMode())
pPed->SetCameraRotation(rotation.data.fRotation);
pPed->SetSyncTimeContext(ucTimeContext);
}
}
Expand Down
Loading