Fixed Two Handed Weapon Scales

This commit is contained in:
Grant Bagwell 2021-04-27 17:30:59 +02:00 committed by Simon
parent 13e47f980a
commit 7216d02b43
3 changed files with 13 additions and 2 deletions

View file

@ -1758,6 +1758,7 @@ void idPlayer::Init( void ) {
InitPlayerBones(); InitPlayerBones();
commonVr->currentFlashlightMode = vr_flashlightMode.GetInteger(); commonVr->currentFlashlightMode = vr_flashlightMode.GetInteger();
commonVr->restoreFlashlightMode = false;
commonVr->thirdPersonMovement = false; commonVr->thirdPersonMovement = false;
commonVr->thirdPersonDelta = 0.0f; commonVr->thirdPersonDelta = 0.0f;
@ -13764,7 +13765,16 @@ void idPlayer::CalculateViewFlashlightPos( idVec3 &origin, idMat3 &axis, idVec3
int flashlightMode = commonVr->GetCurrentFlashlightMode(); int flashlightMode = commonVr->GetCurrentFlashlightMode();
if (commonVr->GetWeaponStabilised() && flashlightMode == FLASHLIGHT_HAND ) if (commonVr->GetWeaponStabilised() && flashlightMode == FLASHLIGHT_HAND )
{ {
flashlightMode = FLASHLIGHT_GUN; //GB Changed as previous wasn't persistent across functions
commonVr->restoreFlashlightMode = true;
vr_flashlightMode.SetInteger( FLASHLIGHT_GUN );
vr_flashlightMode.SetModified();
}
else if (!commonVr->GetWeaponStabilised() && commonVr->restoreFlashlightMode)
{
commonVr->restoreFlashlightMode = false;
vr_flashlightMode.SetInteger( FLASHLIGHT_HAND );
vr_flashlightMode.SetModified();
} }
setLeftHand = false; setLeftHand = false;

View file

@ -279,7 +279,7 @@ iVr::iVr()
wasSaved = false; wasSaved = false;
wasLoaded = false; wasLoaded = false;
shouldRecenter = false; shouldRecenter = false;
restoreFlashlightMode = false;
PDAclipModelSet = false; PDAclipModelSet = false;
useFBO = false; useFBO = false;

View file

@ -181,6 +181,7 @@ public:
//------------------ //------------------
int lastComfortTime; int lastComfortTime;
int currentFlashlightMode; int currentFlashlightMode;
bool restoreFlashlightMode;
bool VR_GAME_PAUSED; bool VR_GAME_PAUSED;