mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-14 00:10:56 +00:00
SERVER: Fix ADS toggle spamming
This commit is contained in:
parent
acd2ac8062
commit
0a631fb74d
3 changed files with 11 additions and 0 deletions
|
@ -13,6 +13,7 @@ Available options:
|
|||
-O - write to a different qc file
|
||||
*/
|
||||
#pragma noref 1
|
||||
#pragma target FTE
|
||||
//#pragma flag enable logicops
|
||||
#pragma warning error Q101 /*too many parms*/
|
||||
#pragma warning error Q105 /*too few parms*/
|
||||
|
|
|
@ -65,6 +65,8 @@ float ach_tracker_barr;
|
|||
float ach_tracker_spin;
|
||||
float ach_tracker_luck;
|
||||
|
||||
.float ads_release;
|
||||
|
||||
.vector oldvelocity;
|
||||
.float lastsound_time;
|
||||
.float isspec;
|
||||
|
|
|
@ -2410,7 +2410,12 @@ void () Weapon_Logic =
|
|||
} else {
|
||||
// Toggle ADS back and forth
|
||||
if (cvar("cl_adsmode")) {
|
||||
|
||||
if (self.ads_release == false)
|
||||
return;
|
||||
|
||||
self.ads_toggle = !self.ads_toggle;
|
||||
self.ads_release = false;
|
||||
|
||||
if (self.ads_toggle == false) {
|
||||
W_AimOut();
|
||||
|
@ -2458,6 +2463,9 @@ void () Weapon_Logic =
|
|||
// AIM button is released
|
||||
else if (!self.button8 && self.zoom) {
|
||||
|
||||
// So ADS toggle knows not to spam updates.
|
||||
self.ads_release = true;
|
||||
|
||||
#ifdef FTE
|
||||
|
||||
if (self.weapon == W_KAR_SCOPE || self.weapon == W_PTRS ||
|
||||
|
|
Loading…
Reference in a new issue