X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fselection.qc;h=7abe976ae2bc0d6c19f4732e2f05859e8cac96eb;hb=0f6c4bee8db75b0aded48382af1c2693b19624de;hp=f8ce9e750cd91091d8e3e54fae0f0857d6108afa;hpb=7779bdd488de14ec800782f2904d49a7f5aa33f8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index f8ce9e750..7abe976ae 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -3,11 +3,13 @@ #include "weaponsystem.qh" #include #include +#include #include #include #include #include #include +#include // switch between weapons void Send_WeaponComplain(entity e, float wpn, float type) @@ -21,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, + IL_EACH(g_items, it.weapon == this.m_id && (it.ItemStatus & ITS_AVAILABLE), { if (it.classname == "droppedweapon" && autocvar_g_showweaponspawns < 2) continue; @@ -73,7 +75,7 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam // always allow selecting the Mine Layer if we placed mines, so that we can detonate them if(wpn == WEP_MINE_LAYER) - IL_EACH(g_mines, it.owner == this, + IL_EACH(g_mines, it.owner == this && it.weaponentity_fld == weaponentity, { f = 1; break; // no need to continue @@ -248,12 +250,12 @@ void W_SwitchToOtherWeapon(entity this, .entity weaponentity) if (this.weapons & set) { this.weapons &= ~set; - ww = w_getbestweapon(this); + ww = w_getbestweapon(this, weaponentity); this.weapons |= set; } else { - ww = w_getbestweapon(this); + ww = w_getbestweapon(this, weaponentity); } if (ww == WEP_Null) return; W_SwitchWeapon_Force(this, ww, weaponentity);