mirror of
https://github.com/DrBeef/Doom3Quest.git
synced 2024-11-23 20:32:44 +00:00
Backpack
When releasing flashlight back to backpack, it will restore previous weapon
This commit is contained in:
parent
ec594e1357
commit
9778a2c6cc
2 changed files with 13 additions and 6 deletions
|
@ -332,9 +332,9 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
{
|
||||
if (pVRClientInfo->backpackitemactive == 1) {
|
||||
//Restores last used weapon if possible
|
||||
char buffer[32];
|
||||
sprintf(buffer, "weapon %i", pVRClientInfo->lastweaponid);
|
||||
sendButtonActionSimple(buffer);
|
||||
if (pVRClientInfo->weaponid != -1) {
|
||||
Android_SetImpuse(UB_IMPULSE0 + pVRClientInfo->weaponid);
|
||||
}
|
||||
pVRClientInfo->backpackitemactive = 0;
|
||||
}
|
||||
else if ((GetTimeInMilliSeconds() - dominantGripPushTime) < vr_reloadtimeoutms) {
|
||||
|
@ -346,9 +346,10 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
|
||||
if (!dominantButton1Pushed && pVRClientInfo->backpackitemactive == 2)
|
||||
{
|
||||
char buffer[32];
|
||||
sprintf(buffer, "weapon %i", pVRClientInfo->lastweaponid);
|
||||
sendButtonActionSimple(buffer);
|
||||
//Restores last used weapon if possible
|
||||
if (pVRClientInfo->weaponid != -1) {
|
||||
Android_SetImpuse(UB_IMPULSE0 + pVRClientInfo->weaponid);
|
||||
}
|
||||
pVRClientInfo->backpackitemactive = 0;
|
||||
}
|
||||
|
||||
|
@ -356,6 +357,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
{
|
||||
pVRClientInfo->backpackitemactive = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (pVRClientInfo->backpackitemactive == 0) {
|
||||
if (dominantGripPushed) {
|
||||
|
|
|
@ -6418,6 +6418,11 @@ void idPlayer::Think( void ) {
|
|||
playerView.CalculateShake();
|
||||
}
|
||||
|
||||
if (pVRClientInfo != nullptr)
|
||||
{
|
||||
pVRClientInfo->weaponid = currentWeapon;
|
||||
}
|
||||
|
||||
if ( !( thinkFlags & TH_THINK ) ) {
|
||||
gameLocal.Printf( "player %d not thinking?\n", entityNumber );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue