void race_StartCompleting()
{
- entity p;
race_completing = 1;
- FOR_EACH_PLAYER(p)
- if(p.deadflag != DEAD_NO)
- race_AbandonRaceCheck(p);
+ FOREACH_CLIENT(IS_PLAYER(it) && it.deadflag != DEAD_NO, LAMBDA(race_AbandonRaceCheck(it)));
}
void race_PreparePlayer()
race_checkpoint_recordholders[i] = string_null;
}
- entity e;
- FOR_EACH_CLIENT(e)
- {
- float p = e.race_place;
- WITH(entity, self, e, race_PreparePlayer());
- e.race_place = p;
- }
+ FOREACH_CLIENT(true, LAMBDA(
+ float p = it.race_place;
+ WITH(entity, self, it, race_PreparePlayer());
+ it.race_place = p;
+ ));
}
void race_ImposePenaltyTime(entity pl, float penalty, string reason)
{
float c;
string s;
- entity p;
float fullstatus;
entity winnerscorekeeper;
entity secondscorekeeper;
WinningConditionHelper_second = world;
winnerscorekeeper = world;
secondscorekeeper = world;
- FOR_EACH_PLAYER(p)
- {
- sk = p.scorekeeper;
+ FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+ sk = it.scorekeeper;
c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
if(c < 0)
{
WinningConditionHelper_second = WinningConditionHelper_winner;
- WinningConditionHelper_winner = p;
+ WinningConditionHelper_winner = it;
secondscorekeeper = winnerscorekeeper;
winnerscorekeeper = sk;
}
c = PlayerScore_Compare(secondscorekeeper, sk, 1);
if(c < 0)
{
- WinningConditionHelper_second = p;
+ WinningConditionHelper_second = it;
secondscorekeeper = sk;
}
}
- }
+ ));
WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
if(WinningConditionHelper_equality)
strunzone(worldstatus);
worldstatus = strzone(s);
- FOR_EACH_CLIENT(p)
- {
+ FOREACH_CLIENT(true, LAMBDA(
string s = "";
if(fullstatus)
{
- s = GetPlayerScoreString(p, 1);
- s = strcat(s, IS_REAL_CLIENT(p) ? ":human" : ":bot");
+ s = GetPlayerScoreString(it, 1);
+ s = strcat(s, IS_REAL_CLIENT(it) ? ":human" : ":bot");
ret_string = string_null;
- if(!IS_PLAYER(p) && !MUTATOR_CALLHOOK(GetPlayerStatus, p, s))
+ if(!IS_PLAYER(it) && !MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
s = strcat(s, ":spectator");
if (ret_string) s = strcat(s, ret_string);
}
else
{
ret_string = string_null;
- if (IS_PLAYER(p) || MUTATOR_CALLHOOK(GetPlayerStatus, p, s))
- s = GetPlayerScoreString(p, 2);
+ if (IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
+ s = GetPlayerScoreString(it, 2);
else
s = "-666";
if (ret_string) s = strcat(s, ret_string);
}
- if(p.clientstatus)
- strunzone(p.clientstatus);
- p.clientstatus = strzone(s);
- }
+ if(it.clientstatus)
+ strunzone(it.clientstatus);
+ it.clientstatus = strzone(s);
+ ));
}
string GetScoreLogLabel(string label, float fl)
plist = world;
- FOR_EACH_CLIENT(p)
- p.(field) = 0;
+ FOREACH_CLIENT(true, LAMBDA(it.(field) = 0));
FOR_EACH_CLIENT(p) if(p.scorekeeper)
{
void Score_NicePrint(entity to)
{
entity p;
- float t, i;
+ float i;
float w;
- t = 0;
+ int t = 0;
for(i = 0; i < MAX_SCORE; ++i)
if(scores_label[i] != "")
++t;
}
t = 0;
- FOR_EACH_CLIENT(p)
- if (!IS_PLAYER(p))
- {
+ FOREACH_CLIENT(!IS_PLAYER(it), LAMBDA(
if (!t)
Score_NicePrint_Spectators(to);
- Score_NicePrint_Spectator(to, p);
+ Score_NicePrint_Spectator(to, it);
t = 1;
- }
+ ));
}
void PlayerScore_PlayerStats(entity p)