ScoreRules_generic();
}
-void ActivateTeamplay()
-{
- serverflags |= SERVERFLAG_TEAMPLAY;
- teamplay = 1;
- cvar_set("teamplay", "2"); // DP needs this for sending proper getstatus replies.
-}
-
void InitGameplayMode()
{
VoteReset();
max_shot_distance = min(230000, vlen(world.maxs - world.mins));
MapInfo_LoadMapSettings(mapname);
- serverflags &= ~SERVERFLAG_TEAMPLAY;
- teamplay = 0;
- cvar_set("teamplay", "0"); // DP needs this for sending proper getstatus replies.
+ GameRules_teams(false);
if (!cvar_value_issafe(world.fog))
{
- LOG_INFO("The current map contains a potentially harmful fog setting, ignored\n");
+ LOG_INFO("The current map contains a potentially harmful fog setting, ignored");
world.fog = string_null;
}
if(MapInfo_Map_fog != "")
// 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
- FOREACH_CLIENT(true, LAMBDA(
+ FOREACH_CLIENT(true, {
float t;
if(IS_PLAYER(it) || it.caplayer)
t = it.team;
}
}
}
- ));
+ });
// if the player who has a forced team has not joined yet, reserve the spot
if(autocvar_g_campaign)
lowest_player_score = 999999999;
// find the lowest-scoring player & bot of that team
- FOREACH_CLIENT(IS_PLAYER(it) && it.team == steam, LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it) && it.team == steam, {
if(it.isbot)
{
if(it.totalfrags < lowest_bot_score)
lowest_player_score = it.totalfrags;
}
}
- ));
+ });
// prefers to move a bot...
if(lowest_bot != NULL)