From: Mario Date: Thu, 13 Nov 2014 10:40:03 +0000 (+1100) Subject: Fix some cases of division by 0 X-Git-Tag: xonotic-v0.8.0~171^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c867391ef3aca64b51f5ddfab514c19ad5556131;p=xonotic%2Fxonotic-data.pk3dir.git Fix some cases of division by 0 --- diff --git a/qcsrc/server/mutators/mutator_buffs.qc b/qcsrc/server/mutators/mutator_buffs.qc index cb2c9bb44..bafa28c9c 100644 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@ -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;