SERVER: Fix ADS toggle spamming

This commit is contained in:
Steam Deck User 2023-03-09 11:31:35 -05:00
parent acd2ac8062
commit 0a631fb74d
3 changed files with 11 additions and 0 deletions

View file

@ -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*/

View file

@ -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;

View file

@ -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 ||