From: Mircea Kitsune Date: Sat, 19 Nov 2011 00:05:04 +0000 (+0200) Subject: Fix a small and unlikely bug that I discovered in Vore Tournament. If a bot does... X-Git-Tag: xonotic-v0.6.0~35^2~52^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=01b67337a27e89ddb84b2c8ad2b2a9a92b05e272;p=xonotic%2Fxonotic-data.pk3dir.git Fix a small and unlikely bug that I discovered in Vore Tournament. If a bot does not have a weapon but attempts to reload it / switch to it, he will have weird animations. Therefore, make sure the bot has the weapon before trying to switch. --- diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 9b7198cef..961a201a1 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -168,7 +168,7 @@ void havocbot_ai() for(i = WEP_FIRST; i <= WEP_LAST; ++i) { e = get_weaponinfo(i); - if ((e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo")))) + if ((self.weapons & i) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo")))) self.switchweapon = i; } }