parent
c6d666aba0
commit
8e382b4f64
|
@ -3553,6 +3553,9 @@ void idPlayer::NextBestWeapon( void ) {
|
||||||
if ( !spawnArgs.GetBool( va( "weapon%d_best", w ) ) ) {
|
if ( !spawnArgs.GetBool( va( "weapon%d_best", w ) ) ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (w == WEAPON_FLASHLIGHT) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
idealWeapon = w;
|
idealWeapon = w;
|
||||||
|
@ -3598,6 +3601,10 @@ void idPlayer::NextWeapon( void ) {
|
||||||
if ( ( inventory.weapons & ( 1 << w ) ) == 0 ) {
|
if ( ( inventory.weapons & ( 1 << w ) ) == 0 ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (w == WEAPON_FLASHLIGHT) {
|
||||||
|
// Don't let user cycle through flashlight, they have to get it from the holster
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ( inventory.HasAmmo( weap ) ) {
|
if ( inventory.HasAmmo( weap ) ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3648,6 +3655,10 @@ void idPlayer::PrevWeapon( void ) {
|
||||||
if ( ( inventory.weapons & ( 1 << w ) ) == 0 ) {
|
if ( ( inventory.weapons & ( 1 << w ) ) == 0 ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (w == WEAPON_FLASHLIGHT) {
|
||||||
|
// Don't let user cycle through flashlight, they have to get it from the holster
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ( inventory.HasAmmo( weap ) ) {
|
if ( inventory.HasAmmo( weap ) ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6334,15 +6345,17 @@ void idPlayer::Think( void ) {
|
||||||
|
|
||||||
if (pVRClientInfo != nullptr)
|
if (pVRClientInfo != nullptr)
|
||||||
{
|
{
|
||||||
if (inventory.weapons > 1) {
|
if (inventory.weapons > WEAPON_FISTS) {
|
||||||
pVRClientInfo->weaponid = currentWeapon;
|
pVRClientInfo->weaponid = currentWeapon;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pVRClientInfo->weaponid = -1;
|
pVRClientInfo->weaponid = -1;
|
||||||
}
|
}
|
||||||
cvarSystem->SetCVarBool("vr_weapon_stabilised", pVRClientInfo->weapon_stabilised);
|
cvarSystem->SetCVarBool("vr_weapon_stabilised", pVRClientInfo->weapon_stabilised);
|
||||||
pVRClientInfo->velocitytriggered = (currentWeapon == 11 || // 11 is flashlight
|
pVRClientInfo->velocitytriggered = (
|
||||||
currentWeapon == 10); // 10 is chainsaw
|
currentWeapon == WEAPON_FISTS ||
|
||||||
|
currentWeapon == WEAPON_FLASHLIGHT ||
|
||||||
|
currentWeapon == WEAPON_CHAINSAW);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear the ik before we do anything else so the skeleton doesn't get updated twice
|
// clear the ik before we do anything else so the skeleton doesn't get updated twice
|
||||||
|
@ -7246,7 +7259,8 @@ void idPlayer::CalculateViewWeaponPos( bool adjusted, idVec3 &origin, idMat3 &ax
|
||||||
const idVec3 &viewOrigin = firstPersonViewOrigin;
|
const idVec3 &viewOrigin = firstPersonViewOrigin;
|
||||||
const idMat3 &viewAxis = firstPersonViewAxis;
|
const idMat3 &viewAxis = firstPersonViewAxis;
|
||||||
|
|
||||||
if (pVRClientInfo)
|
if (pVRClientInfo &&
|
||||||
|
currentWeapon != weapon_pda)
|
||||||
{
|
{
|
||||||
if (adjusted) {
|
if (adjusted) {
|
||||||
angles.pitch = pVRClientInfo->weaponangles[PITCH];
|
angles.pitch = pVRClientInfo->weaponangles[PITCH];
|
||||||
|
@ -7274,7 +7288,7 @@ void idPlayer::CalculateViewWeaponPos( bool adjusted, idVec3 &origin, idMat3 &ax
|
||||||
|
|
||||||
gunpos *= cvarSystem->GetCVarFloat( "vr_worldscale" );
|
gunpos *= cvarSystem->GetCVarFloat( "vr_worldscale" );
|
||||||
|
|
||||||
if (currentWeapon == 11) // Flashlight adjustment
|
if (currentWeapon == WEAPON_FLASHLIGHT) // Flashlight adjustment
|
||||||
{
|
{
|
||||||
idVec3 gunOfs( -14, 9, 20 );
|
idVec3 gunOfs( -14, 9, 20 );
|
||||||
origin = viewOrigin + gunpos + (gunOfs * axis);
|
origin = viewOrigin + gunpos + (gunOfs * axis);
|
||||||
|
|
|
@ -66,6 +66,10 @@ const int FOCUS_GUI_TIME = 500;
|
||||||
|
|
||||||
const int MAX_WEAPONS = 16;
|
const int MAX_WEAPONS = 16;
|
||||||
|
|
||||||
|
const int WEAPON_FISTS = 1;
|
||||||
|
const int WEAPON_CHAINSAW = 10;
|
||||||
|
const int WEAPON_FLASHLIGHT = 11;
|
||||||
|
|
||||||
const int DEAD_HEARTRATE = 0; // fall to as you die
|
const int DEAD_HEARTRATE = 0; // fall to as you die
|
||||||
const int LOWHEALTH_HEARTRATE_ADJ = 20; //
|
const int LOWHEALTH_HEARTRATE_ADJ = 20; //
|
||||||
const int DYING_HEARTRATE = 30; // used for volumen calc when dying/dead
|
const int DYING_HEARTRATE = 30; // used for volumen calc when dying/dead
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue