]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix division by 0 in another way
authorterencehill <piuntn@gmail.com>
Wed, 14 Sep 2016 14:41:02 +0000 (16:41 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 14 Sep 2016 14:41:02 +0000 (16:41 +0200)
qcsrc/common/stats.qh
qcsrc/server/weapons/weaponsystem.qc

index 15de0582766e63e9993fc8e777b48c653e84a145..d6aa068ea67eb775da3cba979c9a62398e9cbcf2 100644 (file)
@@ -64,7 +64,7 @@ REGISTER_STAT(WEAPON_NEXTTHINK, float)
 SPECTATE_COPYFIELD(_STAT(WEAPON_NEXTTHINK))
 float W_WeaponRateFactor(entity this);
 #endif
-REGISTER_STAT(WEAPONRATEFACTOR, float)
+REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this))
 
 REGISTER_STAT(GAMESTARTTIME, float)
 REGISTER_STAT(STRENGTH_FINISHED, float)
index 451c50ec12f13b861254c75a3d4313fea115e0e9..4968d3c31f4d2f813ac5cdddde94f167ec2b52e4 100644 (file)
@@ -21,7 +21,9 @@
 
 float W_WeaponRateFactor(entity this)
 {
-       float t = 1.0 / g_weaponratefactor;
+       float t = 1;
+       if(g_weaponratefactor > 0)
+               t = 1.0 / g_weaponratefactor;
 
        MUTATOR_CALLHOOK(WeaponRateFactor, t, this);
        t = M_ARGV(0, float);