if(self.waypointsprite_attached)
{
setself(self.waypointsprite_attached);
- FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+ FOREACH_CLIENT(IS_REAL_CLIENT(it), {
if(self.waypointsprite_visible_for_player(it))
{
msg_entity = it;
soundto(MSG_ONE, this, CH_TRIGGER, SND(ITEMRESPAWNCOUNTDOWN), VOL_BASE, ATTEN_NORM); // play respawn sound
}
- ));
+ });
setself(this);
WaypointSprite_Ping(self.waypointsprite_attached);
if (w || (item.spawnshieldtime && item.pickup_anyway > 0))
{
pickedup = true;
- FOREACH(Weapons, it != WEP_Null, LAMBDA(
+ FOREACH(Weapons, it != WEP_Null, {
if(w & (it.m_wepset))
{
W_DropEvent(wr_pickup, player, it.m_id, item);
W_GiveWeapon(player, it.m_id);
}
- ));
+ });
}
}
c = 0;
// Detect needed ammo
- FOREACH(Weapons, it != WEP_Null, LAMBDA(
+ FOREACH(Weapons, it != WEP_Null, {
if(!(player.weapons & (it.m_wepset)))
continue;
need_plasma = true;
else if(it.items & ITEM_JetpackFuel.m_itemid)
need_fuel = true;
- ));
+ });
// TODO: figure out if the player even has the weapon this ammo is for?
// may not affect strategy much though...
if(autocvar_spawn_debug >= 2)
{
- for(entity otheritem = findradius(this.origin, 3); otheritem; otheritem = otheritem.chain)
- {
- // why not flags & fl_item?
- if(otheritem.is_item)
- {
- LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(this.origin));
- LOG_TRACE(" vs ", otheritem.netname, vtos(otheritem.origin), "\n");
- error("Mapper sucks.");
- }
- }
+ // why not flags & fl_item?
+ FOREACH_ENTITY_RADIUS(this.origin, 3, it.is_item, {
+ LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(this.origin));
+ LOG_TRACE(" vs ", it.netname, vtos(it.origin), "\n");
+ error("Mapper sucks.");
+ });
this.is_item = true;
}
else if(argv(i) == "fuel_regen") self.items |= ITEM_JetpackRegen.m_itemid;
else
{
- FOREACH(Weapons, it != WEP_Null, LAMBDA(
+ FOREACH(Weapons, it != WEP_Null, {
s = W_UndeprecateName(argv(i));
if(s == it.netname)
{
it.wr_init(it);
break;
}
- ));
+ });
}
}
if(self.ammo_fuel != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_fuel), "fuel");
if(self.health != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "health");
if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.armorvalue), "armor");
- FOREACH(Weapons, it != WEP_Null, LAMBDA(self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & (it.m_wepset)), it.netname)));
+ FOREACH(Weapons, it != WEP_Null, self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & (it.m_wepset)), it.netname));
}
self.netname = strzone(self.netname);
//print(self.netname, "\n");
n = tokenize_console(self.netname);
for(i = 0; i < n; ++i)
{
- FOREACH(Weapons, it != WEP_Null, LAMBDA(
- if(argv(i) == it.netname)
- {
- it.wr_init(it);
- break;
- }
- ));
+ FOREACH(Weapons, it != WEP_Null && argv(i) == it.netname, {
+ it.wr_init(it);
+ break;
+ });
}
}
got += GiveValue(e, health, op, val);
got += GiveValue(e, armorvalue, op, val);
case "allweapons":
- FOREACH(Weapons, it != WEP_Null, LAMBDA(
- if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED))
- got += GiveWeapon(e, it.m_id, op, val);
- ));
+ FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & WEP_FLAG_MUTATORBLOCKED), got += GiveWeapon(e, it.m_id, op, val));
case "allammo":
got += GiveValue(e, ammo_cells, op, val);
got += GiveValue(e, ammo_plasma, op, val);
got += GiveValue(e, ammo_fuel, op, val);
break;
default:
- FOREACH(Weapons, it != WEP_Null, LAMBDA(
- if(cmd == it.netname)
- {
- got += GiveWeapon(e, it.m_id, op, val);
- break;
- }
- ));
+ FOREACH(Weapons, it != WEP_Null && cmd == it.netname, {
+ got += GiveWeapon(e, it.m_id, op, val);
+ break;
+ });
break;
}
val = 999;
POSTGIVE_BIT(e, items, IT_UNLIMITED_SUPERWEAPONS, SND_POWERUP, SND_POWEROFF);
POSTGIVE_BIT(e, items, IT_UNLIMITED_WEAPON_AMMO, SND_POWERUP, SND_POWEROFF);
POSTGIVE_BIT(e, items, ITEM_Jetpack.m_itemid, SND_ITEMPICKUP, SND_Null);
- FOREACH(Weapons, it != WEP_Null, LAMBDA(
+ FOREACH(Weapons, it != WEP_Null, {
POSTGIVE_WEAPON(e, it, SND_WEAPONPICKUP, SND_Null);
if(!(save_weapons & (it.m_wepset)))
if(e.weapons & (it.m_wepset))
it.wr_init(it);
- ));
+ });
POSTGIVE_VALUE(e, strength_finished, 1, SND_POWERUP, SND_POWEROFF);
POSTGIVE_VALUE(e, invincible_finished, 1, SND_Shield, SND_POWEROFF);
POSTGIVE_VALUE(e, ammo_nails, 0, SND_ITEMPICKUP, SND_Null);