void readplayerstartcvars()
{
- entity e;
float i, t;
string s;
warmup_start_weapons = '0 0 0';
warmup_start_weapons_default = '0 0 0';
warmup_start_weapons_defaultmask = '0 0 0';
- for (i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- e = Weapons_from(i);
- int w = want_weapon(e, g_warmup_allguns);
- WepSet s = (e.m_wepset);
+ FOREACH(Weapons, it != WEP_Null, LAMBDA(
+ int w = want_weapon(it, g_warmup_allguns);
+ WepSet s = (it.m_wepset);
if(w & 1)
warmup_start_weapons |= s;
if(w & 2)
warmup_start_weapons_default |= s;
if(w & 4)
warmup_start_weapons_defaultmask |= s;
- }
+ ));
}
}
// returns amount of ammo used as string, or -1 for failure, or 0 for no ammo count
string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo)
{SELFPARAM();
- float thisammo, i;
+ float thisammo;
string s;
Weapon info = Weapons_from(wpn);
var .int ammotype = info.ammo_field;
}
else
{
- float superweapons = 1;
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- WepSet set = WepSet_FromWeapon(Weapons_from(i));
- if ((set & WEPSET_SUPERWEAPONS) && (own.weapons & set)) ++superweapons;
- }
+ int superweapons = 1;
+ FOREACH(Weapons, it != WEP_Null, LAMBDA(
+ WepSet set = it.m_wepset;
+ if((set & WEPSET_SUPERWEAPONS) && (own.weapons & set)) ++superweapons;
+ ));
if(superweapons <= 1)
{
wep.superweapons_finished = own.superweapons_finished;