From bd55ecc04b809ceba474e5f242ea40a9d0e4f3a7 Mon Sep 17 00:00:00 2001
From: Lactozilla <jp6781615@gmail.com>
Date: Sat, 5 Aug 2023 05:39:37 -0300
Subject: [PATCH] Correctly announce team flag name when capturing it

---
 src/p_spec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/p_spec.c b/src/p_spec.c
index a151bab346..6a7e02d888 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -3947,7 +3947,7 @@ boolean P_IsFlagAtBase(mobjtype_t flag)
 {
 	thinker_t *think;
 	mobj_t *mo;
-	sectorspecialflags_t specialflag = (flag == MT_REDFLAG) ? SSF_REDTEAMBASE : SSF_BLUETEAMBASE;
+	sectorspecialflags_t specialflag = (flag == teams[TEAM_RED].flag_mobj_type) ? SSF_REDTEAMBASE : SSF_BLUETEAMBASE;
 
 	for (think = thlist[THINK_MOBJ].next; think != &thlist[THINK_MOBJ]; think = think->next)
 	{
@@ -4660,7 +4660,7 @@ static void P_ProcessTeamBase(player_t *player, UINT8 team)
 
 	HU_SetCEchoFlags(V_AUTOFADEOUT|V_ALLOWLOWERCASE);
 	HU_SetCEchoDuration(5);
-	HU_DoCEcho(va(M_GetText("%s%s\200\\CAPTURED THE %s%s FLAG\200.\\\\\\\\"), GetChatColorForSkincolor(G_GetTeamColor(team)), player_names[player-players], GetChatColorForSkincolor(teams[otherteam].color), G_GetTeamName(otherteam)));
+	HU_DoCEcho(va(M_GetText("%s%s\200\\captured the %s%s\200.\\\\\\\\"), GetChatColorForSkincolor(G_GetTeamColor(team)), player_names[player-players], GetChatColorForSkincolor(G_GetTeamColor(otherteam)), G_GetTeamFlagName(otherteam)));
 
 	if (splitscreen || players[consoleplayer].ctfteam == team)
 		S_StartSound(NULL, sfx_flgcap);
-- 
GitLab