From: TimePath Date: Mon, 30 Nov 2015 02:03:12 +0000 (+1100) Subject: Viewmodels: network weaponrate factor X-Git-Tag: xonotic-v0.8.2~1601^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5aa60c71fe00b407ff016c7806e2ae8fc5491cec;p=xonotic%2Fxonotic-data.pk3dir.git Viewmodels: network weaponrate factor --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 09bfd4544..81098c1eb 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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) { diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 5b2599794..d52329333 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -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)