mirror of
https://github.com/DrBeef/Doom3Quest.git
synced 2024-11-10 06:41:36 +00:00
Fix crash introduced by stabilised weapon logic
This commit is contained in:
parent
b0f9b4ed9a
commit
6e7f124a7d
4 changed files with 14 additions and 3 deletions
|
@ -13389,7 +13389,7 @@ void idPlayer::CalculateViewWeaponPosVR( int hand, idVec3 &origin, idMat3 &axis
|
|||
|
||||
commonVr->MotionControlGetHand( hand, hands[ hand ].motionPosition, hands[ hand ].motionRotation );
|
||||
|
||||
if (!pVRClientInfo->weapon_stabilised)
|
||||
if (!commonVr->GetWeaponStabilised())
|
||||
{
|
||||
weaponPitch = idAngles( vr_motionWeaponPitchAdj.GetFloat(), 0.0f, 0.0f ).ToQuat();
|
||||
hands[hand].motionRotation = weaponPitch * hands[hand].motionRotation;
|
||||
|
@ -13665,7 +13665,7 @@ void idPlayer::CalculateViewFlashlightPos( idVec3 &origin, idMat3 &axis, idVec3
|
|||
axis = idAngles( 0.0, viewAngles.yaw - commonVr->bodyYawOffset, 0.0f ).ToMat3();
|
||||
|
||||
int flashlightMode = commonVr->GetCurrentFlashlightMode();
|
||||
if (pVRClientInfo->weapon_stabilised && flashlightMode == FLASHLIGHT_HAND )
|
||||
if (commonVr->GetWeaponStabilised() && flashlightMode == FLASHLIGHT_HAND )
|
||||
{
|
||||
flashlightMode = FLASHLIGHT_GUN;
|
||||
}
|
||||
|
|
|
@ -1096,6 +1096,16 @@ void iVr::CalcAimMove( float &yawDelta, float &pitchDelta )
|
|||
|
||||
}
|
||||
|
||||
bool iVr::GetWeaponStabilised()
|
||||
{
|
||||
if (pVRClientInfo)
|
||||
{
|
||||
return pVRClientInfo->weapon_stabilised;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -163,6 +163,8 @@ public:
|
|||
void MotionControllerSetHapticOculus( float low, float hi );
|
||||
void MotionControllerSetHapticOpenVR( int hand, unsigned short value );
|
||||
|
||||
bool GetWeaponStabilised();
|
||||
|
||||
//void MSAAResolve( void );
|
||||
//void FXAAResolve( idImage * leftCurrent, idImage * rightCurrent );
|
||||
//void FXAASetUniforms( Framebuffer FBO );
|
||||
|
|
|
@ -2079,7 +2079,6 @@ void idWeapon::BeginAttack( void ) {
|
|||
}
|
||||
}
|
||||
WEAPON_ATTACK = true;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue