]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Viewmodels: network weaponrate factor
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 30 Nov 2015 02:03:12 +0000 (13:03 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 30 Nov 2015 02:03:12 +0000 (13:03 +1100)
qcsrc/client/view.qc
qcsrc/common/stats.qh

index 09bfd4544072bfd01752b0f66047f56478a5e486..81098c1eb13248f029a86ceaad4a1e5039811901 100644 (file)
@@ -304,7 +304,7 @@ void viewmodel_draw(entity this)
                        anim_set(this, this.anim_idle, true, false, false);
        }
        float f = 0; // 0..1; 0: fully active
-       float eta = (this.weapon_nextthink - time); // TODO: / W_WeaponRateFactor();
+       float eta = (this.weapon_nextthink - time) / STAT(WEAPONRATEFACTOR);
        if (eta <= 0) f = this.weapon_eta_last;
        else switch (this.state)
        {
index 5b25997948215433a1a35b46a06f3ffec919461c..d52329333ca400399984919a8e7857cb0ce1007b 100644 (file)
@@ -42,7 +42,9 @@ REGISTER_STAT(SWITCHINGWEAPON, int)
 REGISTER_STAT(WEAPON_NEXTTHINK, float)
 #ifdef SVQC
 SPECTATE_COPY(_STAT(WEAPON_NEXTTHINK))
+float W_WeaponRateFactor();
 #endif
+REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor())
 
 REGISTER_STAT(GAMESTARTTIME, float)
 REGISTER_STAT(STRENGTH_FINISHED, float)