]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix some cases of division by 0
authorMario <zacjardine@y7mail.com>
Thu, 13 Nov 2014 10:40:03 +0000 (21:40 +1100)
committerMario <zacjardine@y7mail.com>
Thu, 13 Nov 2014 10:40:03 +0000 (21:40 +1100)
qcsrc/server/mutators/mutator_buffs.qc

index cb2c9bb4480758f2cebb39f81e73f5166bc756a3..bafa28c9c88dbc86cfbf24718ea4e8be018eb66a 100644 (file)
@@ -456,7 +456,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerPhysics)
 MUTATOR_HOOKFUNCTION(buffs_PlayerJump)
 {
        if(self.buffs & BUFF_JUMP)
-               player_jumpheight = autocvar_g_buffs_jump_height;
+               player_jumpheight = max(autocvar_g_buffs_jump_height, player_jumpheight);
 
        return FALSE;
 }
@@ -550,9 +550,11 @@ MUTATOR_HOOKFUNCTION(buffs_OnEntityPreSpawn)
 MUTATOR_HOOKFUNCTION(buffs_WeaponRate)
 {
        if(self.buffs & BUFF_SPEED)
+       if(autocvar_g_buffs_speed_rate > 0)
                weapon_rate *= autocvar_g_buffs_speed_rate;
                
        if(time < self.buff_disability_time)
+       if(autocvar_g_buffs_disability_rate > 0)
                weapon_rate *= autocvar_g_buffs_disability_rate;
        
        return FALSE;