]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add winning information in battle royale
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Tue, 23 May 2023 11:48:46 +0000 (13:48 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Tue, 23 May 2023 11:48:46 +0000 (13:48 +0200)
qcsrc/common/gamemodes/gamemode/br/sv_br.qc
qcsrc/server/world.qc

index f14f707c001858d9841f7f31d8d2accdeab4c4f4..f04ae0c23e283c50578de33944c98cb969116ea5 100644 (file)
@@ -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);
index 32a32e72e493532637396161881c9a8fac7b53a0..0408f93d2f73c6b74b1fc145c4e83841f176b404 100644 (file)
@@ -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");
                }
        });