From f21caaf674b0f9e92caa4931a36586cac90e2265 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Tue, 10 Dec 2013 17:53:42 -0500 Subject: [PATCH] Skip complain if: We don't own it, it's not normal, and it's not on the map --- qcsrc/server/weapons/selection.qc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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) { -- 2.39.2