Skip to content

Commit ca72176

Browse files
committed
More exceptions to roomscale movement to fix head rotation being stuck during Awakening cutscene
1 parent ba7b3fa commit ca72176

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Code/Player.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,10 +1020,13 @@ void CPlayer::ProcessRoomscaleMovement()
10201020
bool modalHudActive = g_pGame->GetHUD() && g_pGame->GetHUD()->GetModalHUD();
10211021
if (modalHudActive || !m_linkStats.CanRotate() || !g_pGameCVars->vr_enable_motion_controllers)
10221022
return;
1023-
if (GetLinkedVehicle() || m_stats.isOnLadder || !GetEntity()->GetPhysics() || m_stats.mountedWeaponID)
1023+
if (GetLinkedVehicle() || m_stats.isOnLadder || !GetEntity()->GetPhysics() || m_stats.mountedWeaponID || m_stats.isGrabbed || m_stats.isFrozen.Value())
10241024
return;
10251025
if (g_pGame->GetIGameFramework()->GetIViewSystem()->IsPlayingCutScene())
10261026
return;
1027+
IViewSystem* system = g_pGame->GetIGameFramework()->GetIViewSystem();
1028+
if (system && system->GetActiveView() && system->GetActiveView()->GetLinkedId() != GetEntityId())
1029+
return;
10271030

10281031
if (m_stats.inRest <= 0 || m_stats.jumped || m_stats.onGround <= 0) // don't do this while we are otherwise moving, or it will interfere
10291032
return;
@@ -1082,13 +1085,17 @@ void CPlayer::ProcessRoomscaleRotation()
10821085
bool modalHudActive = g_pGame->GetHUD() && g_pGame->GetHUD()->GetModalHUD();
10831086
if (modalHudActive || !m_linkStats.CanRotate() || !g_pGameCVars->vr_enable_motion_controllers)
10841087
return;
1085-
if (GetLinkedVehicle() || m_stats.isOnLadder || !GetEntity()->GetPhysics() || m_stats.mountedWeaponID)
1088+
if (GetLinkedVehicle() || m_stats.isOnLadder || !GetEntity()->GetPhysics() || m_stats.mountedWeaponID || m_stats.isGrabbed || m_stats.isFrozen.Value())
10861089
return;
10871090
if (g_pGame->GetIGameFramework()->GetIViewSystem()->IsPlayingCutScene())
10881091
return;
1092+
IViewSystem* system = g_pGame->GetIGameFramework()->GetIViewSystem();
1093+
if (system && system->GetActiveView() && system->GetActiveView()->GetLinkedId() != GetEntityId())
1094+
return;
10891095

1090-
1091-
if (m_stats.onGround <= 0) // fixme: roomscale rotation feels off during the initial parachute jump
1096+
if (m_stats.onGround <= 0) // don't do this while we are otherwise moving, or it will interfere
1097+
return;
1098+
if (m_params.vLimitRangeH > 0.001f && m_params.vLimitDir.len() > 0.01f)
10921099
return;
10931100

10941101
float hmdYaw = gVR->GetHmdYawOffset();

0 commit comments

Comments
 (0)