]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bots: Fix divide by zero error when using the nex. Made them able to charge the nex.
authormand1nga <mand1nga@xonotic.org>
Mon, 11 Apr 2011 12:22:05 +0000 (09:22 -0300)
committermand1nga <mand1nga@xonotic.org>
Mon, 11 Apr 2011 12:22:05 +0000 (09:22 -0300)
qcsrc/server/w_nex.qc

index a0fce6a31951bd82c0799c9e6399728ace37ada0..2d5ea6aa2fd1818ebff334ffb76b75b34c1e943a 100644 (file)
@@ -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)
        {