X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fselection.qc;h=5ea0a5d9d842c8690cdf979cd7a9c717e5439477;hb=390d33b5f587dc807ae08ffe39adc1d762fc7f4c;hp=8ec11925f2cb9bd983453287c1cbbdc2f115dd42;hpb=845401fd312c66c059aaee1772ac5d79555ab4fc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 8ec11925f..5ea0a5d9d 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -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);