From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Tue, 23 May 2023 11:48:46 +0000 (+0200) Subject: add winning information in battle royale X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2f9e28cd1c7e92f2f9054dc0edc5c1c7ce2ab348;p=xonotic%2Fxonotic-data.pk3dir.git add winning information in battle royale --- diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc index f14f707c0..f04ae0c23 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc @@ -1112,11 +1112,12 @@ int br_WinningCondition() return WINNING_NEVER; entity winner_squad = NULL; - IL_EACH(squads, !it.br_squad_dead, winner_squad = it); + IL_EACH(squads, !it.br_squad_dead, { winner_squad = it; break; }); for(entity member = winner_squad.br_squad_first; member; member = member.br_squad_next) { GameRules_scoring_add(member, BR_RANK, 1); + member.winning = true; } delete(round_handler); diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 32a32e72e..0408f93d2 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -1279,6 +1279,7 @@ void NextLevel() GameLogClose(); int winner_team = 0; + int winner_squad = 0; FOREACH_CLIENT(IS_PLAYER(it) || INGAME(it), { FixIntermissionClient(it); if(it.winning) @@ -1288,6 +1289,11 @@ void NextLevel() winner_team = it.team; bprint(Team_ColorCode(winner_team), Team_ColorName_Upper(winner_team), "^7 team wins the match\n"); } + if(IS_GAMETYPE(BR) && !winner_squad) + { + winner_squad = it.br_squad.br_squad_id; + bprint("squad ", ftos(winner_squad), " wins the match\n"); + } bprint(playername(it.netname, it.team, false), " ^7wins\n"); } });