X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fselection.qc;h=c2a9c32acdef778fac3191045753e8ee80032c60;hb=e51ce3d45d2852ca793118fc73da9c25f789101f;hp=693d5a240456323adab1c259b51dfb2551275386;hpb=b945d959784e5b249c66aea4f3326d8ae048f1cd;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 693d5a240..c2a9c32ac 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -52,7 +52,7 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam // ignore hook button when using other offhand equipment if (this.offhand != OFFHAND_HOOK) - if (wpn == WEP_HOOK && !((this.weapons | weaponsInMap) & WepSet_FromWeapon(wpn))) + if (wpn == WEP_HOOK && !((STAT(WEAPONS, this) | weaponsInMap) & WepSet_FromWeapon(wpn))) complain = 0; if (complain) @@ -66,7 +66,7 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam } if (autocvar_g_weaponswitch_debug == 2 && weaponslot(weaponentity) > 0 && !(wpn.spawnflags & WEP_FLAG_DUALWIELD) && !(PS(this).dual_weapons & wpn.m_wepset)) return false; // no complaints needed - if (this.weapons & WepSet_FromWeapon(wpn)) + if (STAT(WEAPONS, this) & WepSet_FromWeapon(wpn)) { if (andammo) { @@ -161,12 +161,12 @@ float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, fl FOREACH(Weapons, it != WEP_Null, { if(i != weaponwant) if(it.impulse == imp || imp < 0) - if((this.weapons & (it.m_wepset)) || (weaponsInMap & (it.m_wepset))) + if((STAT(WEAPONS, this) & (it.m_wepset)) || (weaponsInMap & (it.m_wepset))) have_other = true; }); // skip weapons we don't own that aren't normal and aren't in the map - if(!(this.weapons & wepset)) + if(!(STAT(WEAPONS, this) & wepset)) if(!(weaponsInMap & wepset)) if((wep.spawnflags & WEP_FLAG_MUTATORBLOCKED) || have_other) continue; @@ -217,12 +217,12 @@ float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, fl FOREACH(Weapons, it != WEP_Null, { if(i != weaponwant) if(it.impulse == imp || imp < 0) - if((this.weapons & (it.m_wepset)) || (weaponsInMap & (it.m_wepset))) + if((STAT(WEAPONS, this) & (it.m_wepset)) || (weaponsInMap & (it.m_wepset))) have_other = true; }); // skip weapons we don't own that aren't normal and aren't in the map - if(!(this.weapons & wepset)) + if(!(STAT(WEAPONS, this) & wepset)) if(!(weaponsInMap & wepset)) if((wep.spawnflags & WEP_FLAG_MUTATORBLOCKED) || have_other) continue; @@ -252,11 +252,11 @@ void W_SwitchToOtherWeapon(entity this, .entity weaponentity) // hack to ensure it switches to an OTHER weapon (in case the other fire mode still has ammo, we want that anyway) Weapon ww; WepSet set = WepSet_FromWeapon(this.(weaponentity).m_weapon); - if (this.weapons & set) + if (STAT(WEAPONS, this) & set) { - this.weapons &= ~set; + STAT(WEAPONS, this) &= ~set; ww = w_getbestweapon(this, weaponentity); - this.weapons |= set; + STAT(WEAPONS, this) |= set; } else { @@ -304,7 +304,7 @@ void W_NextWeapon(entity this, int list, .entity weaponentity) if(list == 0) W_CycleWeapon(this, weaponorder_byid, -1, weaponentity); else if(list == 1) - W_CycleWeapon(this, this.weaponorder_byimpulse, -1, weaponentity); + W_CycleWeapon(this, CS(this).weaponorder_byimpulse, -1, weaponentity); else if(list == 2) W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, -1, weaponentity); } @@ -315,7 +315,7 @@ void W_PreviousWeapon(entity this, float list, .entity weaponentity) if(list == 0) W_CycleWeapon(this, weaponorder_byid, +1, weaponentity); else if(list == 1) - W_CycleWeapon(this, this.weaponorder_byimpulse, +1, weaponentity); + W_CycleWeapon(this, CS(this).weaponorder_byimpulse, +1, weaponentity); else if(list == 2) W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, weaponentity); }