From: Samual Lenks Date: Tue, 10 Dec 2013 22:53:42 +0000 (-0500) Subject: Skip complain if: We don't own it, it's not normal, and it's not on the map X-Git-Tag: xonotic-v0.8.0~152^2~247 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f21caaf674b0f9e92caa4931a36586cac90e2265;p=xonotic%2Fxonotic-data.pk3dir.git Skip complain if: We don't own it, it's not normal, and it's not on the map --- diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 5b43cc5ab..d26ed831f 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -118,6 +118,7 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa switchtonext = switchtolast = 0; first_valid = prev_valid = 0; float weaponcur; + entity wep; if(skipmissing || pl.selectweapon == 0) weaponcur = pl.switchweapon; @@ -133,10 +134,17 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa while(rest != "") { weaponwant = stof(car(rest)); rest = cdr(rest); + wep = get_weaponinfo(weaponwant); if(imp >= 0) - if((get_weaponinfo(weaponwant)).impulse != imp) + if(wep.impulse != imp) continue; + // skip weapons we don't own that aren't normal and aren't in the map + if(!(pl.weapons & WepSet_FromWeapon(weaponwant))) + if(!((get_weaponinfo(weaponwant)).spawnflags & WEP_FLAG_NORMAL)) + if(!(weaponsInMap & WepSet_FromWeapon(weaponwant))) + continue; + ++c; if(!skipmissing || client_hasweapon(pl, weaponwant, TRUE, FALSE)) @@ -173,10 +181,17 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa while(rest != "") { weaponwant = stof(car(rest)); rest = cdr(rest); + wep = get_weaponinfo(weaponwant); if(imp >= 0) - if((get_weaponinfo(weaponwant)).impulse != imp) + if(wep.impulse != imp) continue; + // skip weapons we don't own that aren't normal and aren't in the map + if(!(pl.weapons & WepSet_FromWeapon(weaponwant))) + if(!((get_weaponinfo(weaponwant)).spawnflags & WEP_FLAG_NORMAL)) + if(!(weaponsInMap & WepSet_FromWeapon(weaponwant))) + continue; + --c; if(c == 0) {