]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/scripting.qc
Weapons: require explicit `Weapons_from` call
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / scripting.qc
index b0348125e6cbb9a0ee05d573f045cd0e93bbaad4..96f7af3a1715f1702ec022aedc8baaf0122e6da3 100644 (file)
@@ -570,14 +570,12 @@ float bot_cmd_turn()
 
 float bot_cmd_select_weapon()
 {SELFPARAM();
-       float id;
-
-       id = bot_cmd.bot_cmd_parm_float;
+       float id = bot_cmd.bot_cmd_parm_float;
 
        if(id < WEP_FIRST || id > WEP_LAST)
                return CMD_STATUS_ERROR;
 
-       if(client_hasweapon(self, id, true, false))
+       if(client_hasweapon(self, Weapons_from(id), true, false))
                self.switchweapon = id;
        else
                return CMD_STATUS_ERROR;