From 616213cf90f67aee09c6cd2da981e3cbfd107023 Mon Sep 17 00:00:00 2001 From: div0 Date: Tue, 27 Mar 2007 13:40:46 +0000 Subject: [PATCH] - in-game voting now nags until you have voted - map voting now uses finale (needs outstanding DP patch to not flicker) - FOR_EACH_* loop macros to easier loop over all players git-svn-id: svn://svn.icculus.org/nexuiz/trunk@2257 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/cl_client.qc | 9 +++ data/qcsrc/server/cl_player.qc | 2 +- data/qcsrc/server/clientcommands.qc | 113 ++++++++-------------------- data/qcsrc/server/ctf.qc | 25 +++--- data/qcsrc/server/domination.qc | 12 +-- data/qcsrc/server/g_world.qc | 81 +++++++++----------- data/qcsrc/server/havocbot_roles.qc | 4 +- data/qcsrc/server/miscfunctions.qc | 32 ++++---- data/qcsrc/server/teamplay.qc | 8 +- 9 files changed, 106 insertions(+), 180 deletions(-) diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index d4e289ca5..8f9906e2f 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -1343,6 +1343,7 @@ Called every frame for each client before the physics are run ============= */ void() ctf_setstatus; +.float vote_nagtime; void PlayerPreThink (void) { // version nagging @@ -1359,6 +1360,14 @@ void PlayerPreThink (void) self.version_nagtime = 0; } + // vote nagging + if(self.cvar_scr_centertime) + if(time > self.vote_nagtime) + { + VoteNag(); + self.vote_nagtime = time + self.cvar_scr_centertime * 0.6; + } + if(self.classname == "player") { local vector m1, m2; diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index 86f5403a0..9a054aa9d 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -455,7 +455,7 @@ void UpdateSelectedPlayer() // 2. if we don't have a cursor trace, find the player which is least // mis-aimed at entity p; - for(p = find(world, classname, "player"); p; p = find(p, classname, "player")) + FOR_EACH_PLAYER(p) { float c; c = UpdateSelectedPlayer_canSee(p, selected_score, 100); // 100 = 2.5 meters diff --git a/data/qcsrc/server/clientcommands.qc b/data/qcsrc/server/clientcommands.qc index aca2e053b..1edea793c 100644 --- a/data/qcsrc/server/clientcommands.qc +++ b/data/qcsrc/server/clientcommands.qc @@ -40,43 +40,21 @@ void Say(entity source, float teamsay, string msgin) else msgstr = strzone(strcat("\{1}^3", source.netname, "^7: ", msgin, "\n")); - head = find(world, classname, "player"); - while(head) - { - if(clienttype(head) == CLIENTTYPE_REAL) - if(!teamsay || (head.team == source.team)) - { - sprint(head, msgstr); - if(teamsay) - centerprint(head, cmsgstr); - //stuffcmd(head, "play2 misc/talk.wav\n"); - } - head = find(head, classname, "player"); - } - - if(!teamsay) + if(teamsay) { - head = find(world, classname, "observer"); - while(head) + FOR_EACH_REALPLAYER(head) { - if(clienttype(head) == CLIENTTYPE_REAL) + if(head.team == source.team) { sprint(head, msgstr); - //stuffcmd(head, "play2 misc/talk.wav\n"); + centerprint(head, cmsgstr); } - head = find(head, classname, "observer"); } - head = find(world, classname, "spectator"); - while(head) - { - if(clienttype(head) == CLIENTTYPE_REAL) - { - sprint(head, msgstr); - //stuffcmd(head, "play2 misc/talk.wav\n"); - } - head = find(head, classname, "spectator"); - } - ServerConsoleEcho(substring(msgstr, 1, strlen(msgstr) - 2), TRUE); + } + else + { + bprint(msgstr); + //ServerConsoleEcho(substring(msgstr, 1, strlen(msgstr) - 2), TRUE); } strunzone(msgstr); @@ -461,26 +439,12 @@ float VoteAllowed(string votecommand) { } void VoteReset() { - local string searchclass; - searchclass = "player"; + local entity player; - while (TRUE) + FOR_EACH_CLIENT(player) { - local entity player; - player = find(player, classname, searchclass); - while(player) - { - player.vote_vote = 0; - player = find(player, classname, searchclass); - } - - if("player" == searchclass) { - searchclass = "observer"; - } else if("observer" == searchclass) { - searchclass = "spectator"; - } else { - break; - } + player.vote_vote = 0; + centerprint_expire(player, CENTERPRIO_VOTE); } votecalled = FALSE; @@ -519,6 +483,12 @@ void VoteStop(entity stopper) { VoteReset(); } +void VoteNag() { + if(votecalled) + if(self.vote_vote == 0) + centerprint_atprio(self, CENTERPRIO_VOTE, strcat("^7^3", votecaller.netname, "^2 called a vote for:\n^1", votecalledvote, "\n\n^2You have not voted yet!")); +} + void VoteCount() { local float playercount; playercount = 0; @@ -526,34 +496,16 @@ void VoteCount() { yescount = 0; local float nocount; nocount = 0; - local string searchclass; - searchclass = "player"; + local entity player; - while (TRUE) + FOR_EACH_REALCLIENT(player) { - local entity player; - player = find(player, classname, searchclass); - - while(player) - { - if(clienttype(player) != CLIENTTYPE_BOT) { - if(player.vote_vote < 0) { - nocount++; - } else if(player.vote_vote > 0) { - yescount++; - } - playercount++; - } - player = find(player, classname, searchclass); - } - - if("player" == searchclass) { - searchclass = "observer"; - } else if("observer" == searchclass) { - searchclass = "specator"; - } else { - break; + if(player.vote_vote < 0) { + nocount++; + } else if(player.vote_vote > 0) { + yescount++; } + playercount++; } if((playercount == 1) && votecalledmaster) { @@ -581,16 +533,11 @@ void ReadyCount() local entity e; local float r, p; - e = find(world, classname, "player"); - - while(e) + FOR_EACH_REALPLAYER(e) { - if(clienttype(e) == CLIENTTYPE_REAL) - { - p += 1; - if(e.ready) r += 1; - } - e = find(e, classname, "player"); + p += 1; + if(e.ready) + r += 1; } if(p && r == p) diff --git a/data/qcsrc/server/ctf.qc b/data/qcsrc/server/ctf.qc index cb517d1bd..d93d8c87a 100644 --- a/data/qcsrc/server/ctf.qc +++ b/data/qcsrc/server/ctf.qc @@ -213,15 +213,13 @@ void() FlagTouch = LogCTF("capture", other.flagcarried.team, other); // give credit to the individual player UpdateFrags(other, cvar("g_ctf_flagscore_capture")); + // give credit to all players of the team (rewards large teams) // NOTE: this defaults to 0 - head = find(head, classname, "player"); - while (head) - { + FOR_EACH_PLAYER(head) if (head.team == self.team) UpdateFrags(head, cvar("g_ctf_flagscore_capture_team")); - head = find(head, classname, "player"); - } + sound (self, CHAN_AUTO, self.noise2, 1, ATTN_NONE); RegenFlag (other.flagcarried); other.flagcarried = world; @@ -246,11 +244,9 @@ void() FlagTouch = LogCTF("steal", self.team, other); sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE); - player = find(world, classname, "player"); - while(player) { - if(player.team == self.team) centerprint(player, "The enemy got your flag! Retrieve it!"); - player = find(player, classname, "player"); - } + FOR_EACH_PLAYER(player) + if(player.team == self.team) + centerprint(player, "The enemy got your flag! Retrieve it!"); self.movetype = MOVETYPE_NONE; setorigin(self, FLAG_CARRY_POS); @@ -287,11 +283,10 @@ void() FlagTouch = LogCTF("pickup", self.team, other); sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE); - player = find(world, classname, "player"); - while(player) { - if(player.team == self.team) centerprint(player, "The enemy got your flag! Retrieve it!"); - player = find(player, classname, "player"); - } + FOR_EACH_PLAYER(player) + if(player.team == self.team) + centerprint(player, "The enemy got your flag! Retrieve it!"); + self.movetype = MOVETYPE_NONE; // flag must have MOVETYPE_NONE here, otherwise it will drop through the floor... setorigin(self, FLAG_CARRY_POS); setattachment(self, other, ""); diff --git a/data/qcsrc/server/domination.qc b/data/qcsrc/server/domination.qc index cb1123bcb..2b6e0d38a 100644 --- a/data/qcsrc/server/domination.qc +++ b/data/qcsrc/server/domination.qc @@ -125,26 +125,18 @@ void() dompointthink = { teamfragamt = cvar("g_domination_point_teamamt"); - head = find(head, classname, "player"); - while (head) - { + FOR_EACH_PLAYER(head) if (head.team == self.goalentity.team) UpdateFrags(head, teamfragamt); - head = find(head, classname, "player"); - } } // if the player left the game, changed teams or became spectator, we have to find another player on the same team to give credit to if (!self.enemy.flags || self.enemy.team != self.goalentity.team || self.enemy.killcount == -666) // flags is zero on removed clients { other = self.enemy; - head = find(head, classname, "player"); - while (head) - { + FOR_EACH_PLAYER(head) if (head.team == self.goalentity.team) self.enemy = head; - head = find(head, classname, "player"); - } if(self.enemy == other) // search returned no matching player, reset dom point { dom_controlpoint_setup(); diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index 8123872f0..fde54b135 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -907,8 +907,7 @@ void() DumpStats = fputs(file, strcat(s, "\n")); } - other = findchainflags(flags, FL_CLIENT); - while (other) + FOR_EACH_CLIENT(other) { if ((clienttype(other) == CLIENTTYPE_REAL) || (clienttype(other) == CLIENTTYPE_BOT && cvar("sv_logscores_bots"))) { @@ -924,7 +923,6 @@ void() DumpStats = else if(cvar("sv_logscores_console")) ServerConsoleEcho(strcat(s, other.netname), TRUE); } - other = other.chain; } if(cvar("sv_eventlog") && gameover) @@ -944,18 +942,23 @@ void FixIntermissionClient(entity e) { e.angles = e.v_angle; e.autoscreenshot = time + 0.8; // used for autoscreenshot - e.armorvalue = 0; - e.health = -42; // show scoreboard + e.health = -2342; + // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not) e.solid = SOLID_NOT; e.movetype = MOVETYPE_NONE; e.takedamage = DAMAGE_NO; if(e.weaponentity) e.weaponentity.effects = EF_NODRAW; - stuffcmd(e, "\ncl_gravity 0\ncl_movement_maxspeed 0\ncl_movement_jumpvelocity 0\ncl_movement_maxairspeed 0\n"); + stuffcmd(e, "\nscr_printspeed 1000000\n"); + if(clienttype(e) == CLIENTTYPE_REAL) + { + msg_entity = e; + WriteByte(MSG_ONE, SVC_INTERMISSION); + } } - e.velocity = '0 0 0'; - e.fixangle = TRUE; // (e.health <= 0); + //e.velocity = '0 0 0'; + //e.fixangle = TRUE; // TODO halt weapon animation } @@ -998,7 +1001,7 @@ void() NextLevel = GameLogClose(); maxTotalFrags = 0; - for(other = world; (other = findflags(other, flags, FL_CLIENT)); ) + FOR_EACH_CLIENT(other) { if(maxTotalFrags < other.totalfrags) maxTotalFrags = other.totalfrags; @@ -1006,7 +1009,7 @@ void() NextLevel = minTotalFrags = other.totalfrags; } - for(other = world; (other = findflags(other, flags, FL_CLIENT)); ) + FOR_EACH_CLIENT(other) { FixIntermissionClient(other); @@ -1085,37 +1088,25 @@ float(float fraglimitreached, float equality) GetWinningCode = void(.float field, float value) SetWinners = { entity head; - head = findchain(classname, "player"); - while (head) - { + FOR_EACH_PLAYER(head) head.winning = (head.field == value); - head = head.chain; - } } // set the .winning flag for those players with a given field value void(.float field, float value) AddWinners = { entity head; - head = findchain(classname, "player"); - while (head) - { + FOR_EACH_PLAYER(head) if(head.field == value) head.winning = 1; - head = head.chain; - } } // clear the .winning flags void(void) ClearWinners = { entity head; - head = findchain(classname, "player"); - while (head) - { + FOR_EACH_PLAYER(head) head.winning = 0; - head = head.chain; - } } float() LMS_NewPlayerLives = @@ -1201,9 +1192,8 @@ float() WinningCondition_LMS = // check if the top two players have equal score. checkrules_leaderfrags = 0; - head = findchain(classname, "player"); checkrules_equality = FALSE; - while (head) + FOR_EACH_PLAYER(head) { if(head.frags > checkrules_leaderfrags) { @@ -1212,7 +1202,6 @@ float() WinningCondition_LMS = } else if(head.frags > 0 && head.frags == checkrules_leaderfrags) checkrules_equality = TRUE; - head = head.chain; } SetWinners(frags, checkrules_leaderfrags); @@ -1237,9 +1226,8 @@ float(float fraglimit) WinningCondition_MaxIndividualScore = checkrules_oldleaderfrags = checkrules_leaderfrags; checkrules_leaderfrags = 0; - head = findchain(classname, "player"); checkrules_equality = FALSE; - while (head) + FOR_EACH_PLAYER(head) { if(head.frags > checkrules_leaderfrags) { @@ -1248,7 +1236,6 @@ float(float fraglimit) WinningCondition_MaxIndividualScore = } else if(head.frags > 0 && head.frags == checkrules_leaderfrags) checkrules_equality = TRUE; - head = head.chain; } if(checkrules_leaderfrags > 0) @@ -1322,8 +1309,7 @@ float(float fraglimit) WinningCondition_MaxTeamSum = team1_score = team2_score = team3_score = team4_score = 0; - head = findchain(classname, "player"); - while (head) + FOR_EACH_PLAYER(head) { if(head.team == COLOR_TEAM1) team1_score += head.frags; @@ -1333,7 +1319,6 @@ float(float fraglimit) WinningCondition_MaxTeamSum = team3_score += head.frags; else if(head.team == COLOR_TEAM4) team4_score += head.frags; - head = head.chain; } return WinningConditionBase_Teamplay(fraglimit); @@ -1348,8 +1333,7 @@ float(float fraglimit) WinningCondition_MaxTeamMax = team1_score = team2_score = team3_score = team4_score = 0; - head = findchain(classname, "player"); - while (head) + FOR_EACH_PLAYER(head) { if(head.team == COLOR_TEAM1) { @@ -1371,7 +1355,6 @@ float(float fraglimit) WinningCondition_MaxTeamMax = if(head.frags > team4_score) team4_score = head.frags; } - head = head.chain; } return WinningConditionBase_Teamplay(fraglimit); @@ -1394,9 +1377,8 @@ void PrintScoreboardFor(entity e, string name, string colorcode, float whichteam string s; float found; found = FALSE; - head = find(world, classname, "player"); teamvalue = 0; - while(head) + FOR_EACH_PLAYER(head) { if(!whichteam || head.team == whichteam) { @@ -1417,7 +1399,6 @@ void PrintScoreboardFor(entity e, string name, string colorcode, float whichteam s = strcat(s, " / ", ftos(v)); print_to(e, strcat(" ", colorcode, head.netname, colorcode, " (", s, ")")); } - head = find(head, classname, "player"); } if(whichteam && found) { @@ -1750,7 +1731,7 @@ float mapvote_votes[MAPVOTE_COUNT]; void MapVote_ClearAllVotes() { - for(other = world; (other = findflags(other, flags, FL_CLIENT)); ) + FOR_EACH_CLIENT(other) other.mapvote = 0; } @@ -1855,7 +1836,7 @@ float MapVote_Finished(float mappos) if(mapvote_maps_suggested[mappos]) GameLogEcho(strcat(":vote:suggestion_accepted:", mapvote_maps[mappos]), FALSE); - for(other = world; (other = findflags(other, flags, FL_CLIENT)); ) if(clienttype(other) == CLIENTTYPE_REAL) + FOR_EACH_REALCLIENT(other) FixClientCvars(other); Map_Goto_SetStr(mapvote_maps[mappos]); @@ -1873,7 +1854,7 @@ void MapVote_CheckRules_1() } mapvote_voters = 0; - for(other = world; (other = findflags(other, flags, FL_CLIENT)); ) if(clienttype(other) == CLIENTTYPE_REAL) + FOR_EACH_REALCLIENT(other) { ++mapvote_voters; if(other.mapvote) @@ -1951,13 +1932,19 @@ void MapVote_Tick() if(MapVote_CheckRules_2()) // decide return; - for(other = world; (other = findflags(other, flags, FL_CLIENT)); ) if(clienttype(other) == CLIENTTYPE_REAL) + FOR_EACH_REALCLIENT(other) { // hide scoreboard again if(other.health != 2342) { - stuffcmd(other, "\nin_bind 7 1 \"impulse 1\"; in_bind 7 2 \"impulse 2\"; in_bind 7 3 \"impulse 3\"; in_bind 7 4 \"impulse 4\"; in_bind 7 5 \"impulse 5\"; in_bind 7 6 \"impulse 6\"; in_bind 7 7 \"impulse 7\"; in_bind 7 8 \"impulse 8\"; in_bind 7 9 \"impulse 9\"; in_bind 7 0 \"impulse 10\"; in_bind 7 KP_1 \"impulse 1\"; in_bind 7 KP_2 \"impulse 2\"; in_bind 7 KP_3 \"impulse 3\"; in_bind 7 KP_4 \"impulse 4\"; in_bind 7 KP_5 \"impulse 5\"; in_bind 7 KP_6 \"impulse 6\"; in_bind 7 KP_7 \"impulse 7\"; in_bind 7 KP_8 \"impulse 8\"; in_bind 7 KP_9 \"impulse 9\"; in_bind 7 KP_0 \"impulse 10\"; in_bindmap 7 0\n"); other.health = 2342; + if(clienttype(other) == CLIENTTYPE_REAL) + { + stuffcmd(other, "\nin_bind 7 1 \"impulse 1\"; in_bind 7 2 \"impulse 2\"; in_bind 7 3 \"impulse 3\"; in_bind 7 4 \"impulse 4\"; in_bind 7 5 \"impulse 5\"; in_bind 7 6 \"impulse 6\"; in_bind 7 7 \"impulse 7\"; in_bind 7 8 \"impulse 8\"; in_bind 7 9 \"impulse 9\"; in_bind 7 0 \"impulse 10\"; in_bind 7 KP_1 \"impulse 1\"; in_bind 7 KP_2 \"impulse 2\"; in_bind 7 KP_3 \"impulse 3\"; in_bind 7 KP_4 \"impulse 4\"; in_bind 7 KP_5 \"impulse 5\"; in_bind 7 KP_6 \"impulse 6\"; in_bind 7 KP_7 \"impulse 7\"; in_bind 7 KP_8 \"impulse 8\"; in_bind 7 KP_9 \"impulse 9\"; in_bind 7 KP_0 \"impulse 10\"; in_bindmap 7 0\n"); + msg_entity = other; + WriteByte(MSG_ONE, SVC_FINALE); + WriteString(MSG_ONE, ""); + } } // notify about keep-two @@ -1976,7 +1963,7 @@ void MapVote_Tick() MapVote_CheckRules_1(); // just count - for(other = world; (other = findflags(other, flags, FL_CLIENT)); ) if(clienttype(other) == CLIENTTYPE_REAL) + FOR_EACH_REALCLIENT(other) { // display voting screen msgstr = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; @@ -2007,7 +1994,7 @@ void MapVote_Tick() msgstr = strcat(msgstr, "s"); msgstr = strcat(msgstr, " left"); - centerprint(other, msgstr); + centerprint_atprio(other, CENTERPRIO_MAPVOTE, msgstr); } } void MapVote_Think() diff --git a/data/qcsrc/server/havocbot_roles.qc b/data/qcsrc/server/havocbot_roles.qc index dbd7b76ca..6803a4b99 100644 --- a/data/qcsrc/server/havocbot_roles.qc +++ b/data/qcsrc/server/havocbot_roles.qc @@ -73,8 +73,7 @@ void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplay //dprint(ftos(self.team)); dprint(" -> noteam is "); dprint(ftos(noteam)); //dprint("\n"); - head = findchain(classname, "player"); - while (head) + FOR_EACH_PLAYER(head) { if (self != head) if (head.health > 0) @@ -91,7 +90,6 @@ void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplay navigation_routerating(head, t * ratingscale); } } - head = head.chain; } }; diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index 699b87dff..c1ff7376b 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -1,16 +1,19 @@ +#define FOR_EACH_CLIENT(v) for(v = world; (v = findflags(v, flags, FL_CLIENT)) != world; ) +#define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if(clienttype(v) == CLIENTTYPE_REAL) +string STR_PLAYER = "player"; +#define FOR_EACH_PLAYER(v) for(v = world; (v = find(v, classname, STR_PLAYER)) != world; ) +#define FOR_EACH_REALPLAYER(v) FOR_EACH_PLAYER(v) if(clienttype(v) == CLIENTTYPE_REAL) + float logfile_open; float logfile; void(string s) bcenterprint { + // TODO replace by MSG_ALL (would show it to spectators too, though)? entity head; - head = find(world, classname, "player"); - while(head) - { + FOR_EACH_PLAYER(head) if(clienttype(head) == CLIENTTYPE_REAL) centerprint(head, s); - head = find(head, classname, "player"); - } } void(string s, float check_dangerous) ServerConsoleEcho = @@ -404,21 +407,15 @@ void DistributeFragsAmongTeam(entity p, float targetteam, float factor) p.frags = p.frags - f; nTeam = 0; - head = find(world, classname, "player"); - while(head) - { + FOR_EACH_PLAYER(head) if(head != p) if(head.team == targetteam) nTeam = nTeam + 1; - head = find(head, classname, "player"); - } if(nTeam == 0) return; - head = find(world, classname, "player"); - while(head) - { + FOR_EACH_PLAYER(head) if(head != p) if(head.team == targetteam) { @@ -427,8 +424,6 @@ void DistributeFragsAmongTeam(entity p, float targetteam, float factor) f = f - d; nTeam = nTeam - 1; } - head = find(head, classname, "player"); - } if(nTeam != 0) error("nPlayers in team changed!"); @@ -503,11 +498,16 @@ string decolorize(string s) } #define CENTERPRIO_POINT 1 +#define CENTERPRIO_VOTE 4 #define CENTERPRIO_NORMAL 5 +#define CENTERPRIO_MAPVOTE 9 .float centerprint_priority; .float centerprint_expires; void centerprint_atprio(entity e, float prio, string s) { + if(intermission_running) + if(prio < CENTERPRIO_MAPVOTE) + return; if(time > e.centerprint_expires) e.centerprint_priority = 0; if(prio >= e.centerprint_priority) @@ -529,3 +529,5 @@ void centerprint(entity e, string s) { centerprint_atprio(e, CENTERPRIO_NORMAL, s); } + +void VoteNag(); diff --git a/data/qcsrc/server/teamplay.qc b/data/qcsrc/server/teamplay.qc index 279949b98..372e01611 100644 --- a/data/qcsrc/server/teamplay.qc +++ b/data/qcsrc/server/teamplay.qc @@ -565,8 +565,7 @@ void GetTeamCounts(entity ignore) // FIXME: also find and memorize the lowest-scoring bot on each team (in case players must be shuffled around) // also remember the lowest-scoring player - head = find(world, classname, "player"); - while(head) + FOR_EACH_PLAYER(head) { if(head != ignore)// && head.netname != "") { @@ -604,7 +603,6 @@ void GetTeamCounts(entity ignore) } } } - head = find(head, classname, "player"); } } @@ -995,8 +993,7 @@ void ShufflePlayerOutOfTeam (float source_team) lowest_player_score = 999999999; // find the lowest-scoring player & bot of that team - head = find(world, classname, "player"); - while(head) + FOR_EACH_PLAYER(head) { if(head.team == steam) { @@ -1017,7 +1014,6 @@ void ShufflePlayerOutOfTeam (float source_team) } } } - head = find(head, classname, "player"); } // prefers to move a bot... -- 2.39.2