]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/selection.qc
Declare more ints as ints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / selection.qc
index 8ec11925f2cb9bd983453287c1cbbdc2f115dd42..5ea0a5d9d842c8690cdf979cd7a9c717e5439477 100644 (file)
@@ -1,3 +1,18 @@
+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+       #include "../../dpdefs/progsdefs.qh"
+    #include "../../dpdefs/dpextensions.qh"
+    #include "../../common/constants.qh"
+    #include "../../common/util.qh"
+    #include "../../common/weapons/weapons.qh"
+    #include "selection.qh"
+    #include "weaponsystem.qh"
+    #include "../t_items.qh"
+    #include "../autocvars.qh"
+    #include "../defs.qh"
+#endif
+
 // switch between weapons
 void Send_WeaponComplain(entity e, float wpn, float type)
 {
@@ -18,7 +33,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
 
        if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
                complain = 0;
-               
+
        if(complain)
                self.hasweapon_complain_spam = time + 0.2;
 
@@ -108,8 +123,7 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa
 {
        // We cannot tokenize in this function, as GiveItems calls this
        // function. Thus we must use car/cdr.
-       float weaponwant, first_valid, prev_valid, switchtonext, switchtolast, c;
-       string rest;
+       float weaponwant, first_valid, prev_valid, switchtonext, switchtolast;
        WepSet wepset = '0 0 0';
        switchtonext = switchtolast = 0;
        first_valid = prev_valid = 0;
@@ -124,9 +138,9 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa
        if(dir == 0)
                switchtonext = 1;
 
-       c = 0;
+       int c = 0;
 
-       rest = weaponorder;
+       string rest = weaponorder;
        while(rest != "")
        {
                weaponwant = stof(car(rest)); rest = cdr(rest);