From: mand1nga Date: Mon, 11 Apr 2011 12:22:05 +0000 (-0300) Subject: Bots: Fix divide by zero error when using the nex. Made them able to charge the nex. X-Git-Tag: xonotic-v0.5.0~274^2~1^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=25e0877a52566a8dd940991461fe3d994666f5c5;p=xonotic%2Fxonotic-data.pk3dir.git Bots: Fix divide by zero error when using the nex. Made them able to charge the nex. --- diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index a0fce6a31..2d5ea6aa2 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -87,8 +87,13 @@ float w_nex(float req) float ammo_amount; if (req == WR_AIM) { - self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE); - self.BUTTON_ATCK2 = bot_aim(1000000, 0, 1, FALSE); + if(bot_aim(1000000, 0, 1, FALSE)) + self.BUTTON_ATCK = TRUE; + else + { + if(autocvar_g_balance_nex_charge) + self.BUTTON_ATCK2 = TRUE; + } } else if (req == WR_THINK) {