X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fselection.qc;h=539371a53cbe9c94b87e388deac95b290d1850cd;hp=8e3e1075899707fdcf6248ce297f5e0394ec061d;hb=b0a563c3658ec620ddb9037b9417b743a47002a5;hpb=36a3cd7d36531bca786228cf9c23368f7d7cb1c5 diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 8e3e10758..539371a53 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -3,9 +3,10 @@ #include "weaponsystem.qh" #include #include +#include #include #include -#include +#include #include #include @@ -21,15 +22,13 @@ void Send_WeaponComplain(entity e, float wpn, float type) void Weapon_whereis(Weapon this, entity cl) { if (!autocvar_g_showweaponspawns) return; - FOREACH_ENTITY_FLOAT(weapon, this.m_id, + IL_EACH(g_items, it.weapon == this.m_id, { if (it.classname == "droppedweapon" && autocvar_g_showweaponspawns < 2) continue; - if (!(it.flags & FL_ITEM)) - continue; entity wp = WaypointSprite_Spawn( WP_Weapon, - 1, 0, + -2, 0, NULL, it.origin + ('0 0 1' * it.maxs.z) * 1.2, cl, 0, NULL, enemy, @@ -101,7 +100,15 @@ bool client_hasweapon(entity this, Weapon wpn, float andammo, bool complain) if (weaponsInMap & WepSet_FromWeapon(wpn)) { Send_WeaponComplain(this, wpn.m_id, 1); - Weapon_whereis(wpn, this); + if(autocvar_g_showweaponspawns < 3) + Weapon_whereis(wpn, this); + else + { + FOREACH(Weapons, it.impulse == wpn.impulse, + { + Weapon_whereis(it, this); + }); + } } else { @@ -264,8 +271,11 @@ void W_SwitchWeapon(entity this, Weapon w) } else if(!forbidWeaponUse(this)) { entity actor = this; - .entity weaponentity = weaponentities[0]; // TODO: unhardcode - w.wr_reload(w, actor, weaponentity); + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity weaponentity = weaponentities[slot]; + w.wr_reload(w, actor, weaponentity); + } } }