net_eff.eent_net_count = eff_cnt;
net_eff.eent_eff_trail = eff.eent_eff_trail;
- entity e; FOR_EACH_REALCLIENT(e) Net_Write_Effect(net_eff, e, 0);
+ FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(Net_Write_Effect(net_eff, it, 0)));
remove(net_eff);
}
void Pause_TryPause(bool ispaused)
{
int n = 0;
- entity it;
- FOR_EACH_REALPLAYER(it)
- {
+ FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
if (PHYS_INPUT_BUTTON_CHAT(it) != ispaused) return;
++n;
- }
+ ));
if (!n) return;
setpause(ispaused);
}
LOG_INFO("CEFC time: ", ftos(t * 1000), "ms; ");
int c_seeing = 0;
int c_seen = 0;
- entity cl;
- FOR_EACH_CLIENT(cl)
- {
- if(IS_REAL_CLIENT(cl))
+ FOREACH_CLIENT(true, LAMBDA(
+ if(IS_REAL_CLIENT(it))
++c_seeing;
- if(IS_PLAYER(cl))
+ if(IS_PLAYER(it))
++c_seen;
- }
+ ));
LOG_INFO("CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ");
LOG_INFO("CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0'), "\n");
// Find all non-hit players the beam passed close by
if(deathtype == WEP_VAPORIZER.m_id || deathtype == WEP_VORTEX.m_id)
{
+ FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != self, LAMBDA(
+ if(!it.railgunhit)
+ if(!(IS_SPEC(it) && it.enemy == self))
+ {
+ msg_entity = it;
+ // nearest point on the beam
+ beampos = start + dir * bound(0, (msg_entity.origin - start) * dir, length);
+
+ f = bound(0, 1 - vlen(beampos - msg_entity.origin) / 512, 1);
+ if(f <= 0)
+ continue;
+
+ snd = SND(NEXWHOOSH_RANDOM());
+
+ if(!pseudoprojectile)
+ pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
+ soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTEN_NONE);
+ }
+ ));
FOR_EACH_REALCLIENT(msg_entity)
if(msg_entity != self)
if(!msg_entity.railgunhit)
if(!(IS_SPEC(msg_entity) && msg_entity.enemy == self)) // we use realclient, so spectators can hear the whoosh too
{
- // nearest point on the beam
- beampos = start + dir * bound(0, (msg_entity.origin - start) * dir, length);
-
- f = bound(0, 1 - vlen(beampos - msg_entity.origin) / 512, 1);
- if(f <= 0)
- continue;
-
- snd = SND(NEXWHOOSH_RANDOM());
-
- if(!pseudoprojectile)
- pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
- soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTEN_NONE);
+
}
if(pseudoprojectile)