X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fselection.qc;h=776d8d8d0f43800999a3b10829cb3c9c20cc2d93;hb=ee5353529c2fee304ac944aa19af53cc85eca7b0;hp=7abe976ae2bc0d6c19f4732e2f05859e8cac96eb;hpb=0f6c4bee8db75b0aded48382af1c2693b19624de;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 7abe976ae..776d8d8d0 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -23,7 +23,7 @@ void Send_WeaponComplain(entity e, float wpn, float type) void Weapon_whereis(Weapon this, entity cl) { if (!autocvar_g_showweaponspawns) return; - IL_EACH(g_items, it.weapon == this.m_id && (it.ItemStatus & ITS_AVAILABLE), + IL_EACH(g_items, it.weapon == this.m_id && (!it.team || (it.ItemStatus & ITS_AVAILABLE)), { if (it.classname == "droppedweapon" && autocvar_g_showweaponspawns < 2) continue; @@ -44,7 +44,7 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam { float f = 0; - if (time < this.hasweapon_complain_spam) + if (time < CS(this).hasweapon_complain_spam) complain = 0; // ignore hook button when using other offhand equipment @@ -53,7 +53,7 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam complain = 0; if (complain) - this.hasweapon_complain_spam = time + 0.2; + CS(this).hasweapon_complain_spam = time + 0.2; if (wpn == WEP_Null) { @@ -61,6 +61,8 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam sprint(this, "Invalid weapon\n"); return false; } + 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 (andammo) @@ -288,7 +290,7 @@ void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponent void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity) { float w; - w = W_GetCycleWeapon(this, this.cvar_cl_weaponpriority, +1, imp, 1, (this.cvar_cl_weaponimpulsemode == 0), weaponentity); + w = W_GetCycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity); if(w > 0) W_SwitchWeapon(this, Weapons_from(w), weaponentity); } @@ -301,7 +303,7 @@ void W_NextWeapon(entity this, int list, .entity weaponentity) else if(list == 1) W_CycleWeapon(this, this.weaponorder_byimpulse, -1, weaponentity); else if(list == 2) - W_CycleWeapon(this, this.cvar_cl_weaponpriority, -1, weaponentity); + W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, -1, weaponentity); } // prev weapon @@ -312,7 +314,7 @@ void W_PreviousWeapon(entity this, float list, .entity weaponentity) else if(list == 1) W_CycleWeapon(this, this.weaponorder_byimpulse, +1, weaponentity); else if(list == 2) - W_CycleWeapon(this, this.cvar_cl_weaponpriority, +1, weaponentity); + W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, weaponentity); } // previously used if exists and has ammo, (second) best otherwise