]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/selection.qc
Merge remote-tracking branch 'origin/DefaultUser/ca_spectator_fix'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / selection.qc
index 18dc4001a9683999d41015a59c18fef931c4077e..0288347ee1f1e61bdaa47cc70b93479c04f2f02f 100644 (file)
@@ -21,7 +21,7 @@ void Send_WeaponComplain(entity e, float wpn, float type)
 void Weapon_whereis(Weapon this, entity cl)
 {
        if (!autocvar_g_showweaponspawns) return;
-       for (entity it = NULL; (it = findfloat(it, weapon, this.m_id)); )
+       FOREACH_ENTITY_FLOAT(weapon, this.m_id,
        {
                if (it.classname == "droppedweapon" && autocvar_g_showweaponspawns < 2)
                        continue;
@@ -37,7 +37,7 @@ void Weapon_whereis(Weapon this, entity cl)
                        RADARICON_NONE
                );
                wp.wp_extra = this.m_id;
-       }
+       });
 }
 
 bool client_hasweapon(entity this, Weapon wpn, float andammo, bool complain)
@@ -71,7 +71,7 @@ bool client_hasweapon(entity this, Weapon wpn, float andammo, bool complain)
                        }
                        else
                        {
-                               WITHSELF(this, f = wpn.wr_checkammo1(wpn) + wpn.wr_checkammo2(wpn));
+                               f = wpn.wr_checkammo1(wpn, this) + wpn.wr_checkammo2(wpn, this);
 
                                // always allow selecting the Mine Layer if we placed mines, so that we can detonate them
                                if(wpn == WEP_MINE_LAYER)