void botframe_showwaypointlinks()
{
- entity player, head, w;
+ entity head, w;
if (time < botframe_waypointeditorlightningtime)
return;
botframe_waypointeditorlightningtime = time + 0.5;
- player = find(world, classname, "player");
- while (player)
- {
- if (!player.isbot)
- if (IS_ONGROUND(player) || player.waterlevel > WATERLEVEL_NONE)
+ FOREACH_CLIENT(IS_PLAYER(it) && !it.isbot, LAMBDA(
+ if(IS_ONGROUND(it) || it.waterlevel > WATERLEVEL_NONE)
{
//navigation_testtracewalk = true;
- head = navigation_findnearestwaypoint(player, false);
+ head = navigation_findnearestwaypoint(it, false);
// print("currently selected WP is ", etos(head), "\n");
//navigation_testtracewalk = false;
if (head)
{
- w = head ;if (w) te_lightning2(world, w.origin, player.origin);
+ w = head ;if (w) te_lightning2(world, w.origin, it.origin);
w = head.wp00;if (w) te_lightning2(world, w.origin, head.origin);
w = head.wp01;if (w) te_lightning2(world, w.origin, head.origin);
w = head.wp02;if (w) te_lightning2(world, w.origin, head.origin);
w = head.wp31;if (w) te_lightning2(world, w.origin, head.origin);
}
}
- player = find(player, classname, "player");
- }
+ ));
}
float botframe_autowaypoints_fixdown(vector v)
void CampaignPreIntermission()
{
- entity head;
- float won;
- float lost;
+ int won = 0;
+ int lost = 0;
string savevar;
- won = lost = 0;
-
- head = findchain(classname, "player");
- while(head)
- {
- if(IS_REAL_CLIENT(head))
- {
- if(head.winning)
- won = won + 1;
- else
- lost = lost + 1;
- }
- head = head.chain;
- }
+ FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+ if(it.winning)
+ won += 1;
+ else
+ lost += 1;
+ ));
if(autocvar__campaign_testrun)
{
// LMS winning condition: game terminates if and only if there's at most one
// one player who's living lives. Top two scores being equal cancels the time
// limit.
-float WinningCondition_LMS()
+int WinningCondition_LMS()
{
entity head, head2;
- float have_player;
- float have_players;
- float l;
+ bool have_player = false;
+ bool have_players = false;
- have_player = false;
- have_players = false;
- l = LMS_NewPlayerLives();
+ int l = LMS_NewPlayerLives();
head = find(world, classname, "player");
if(head)