diff --git a/main/source/cl_dll/input.cpp b/main/source/cl_dll/input.cpp index db5847bb..c5b27b67 100644 --- a/main/source/cl_dll/input.cpp +++ b/main/source/cl_dll/input.cpp @@ -148,6 +148,7 @@ cvar_t *cl_mutemenu; cvar_t *cl_weaponcfgs; cvar_t *cl_pistoltrigger; cvar_t *cl_cmcancellast; +cvar_t *cl_teamcfgs; /* =============================================================================== @@ -1760,6 +1761,7 @@ void InitInput (void) cl_weaponcfgs = gEngfuncs.pfnRegisterVariable ("cl_weaponcfgs", "1", FCVAR_ARCHIVE); cl_pistoltrigger = gEngfuncs.pfnRegisterVariable ("cl_pistoltrigger", "1", FCVAR_ARCHIVE); cl_cmcancellast = gEngfuncs.pfnRegisterVariable("cl_cmcancellast", "0", FCVAR_ARCHIVE); + cl_teamcfgs = gEngfuncs.pfnRegisterVariable("cl_teamcfgs", "1", FCVAR_ARCHIVE); gEngfuncs.pfnRegisterVariable("cl_placebo", "0", 0); // Junk command for options menu dividers. diff --git a/main/source/cl_dll/vgui_ScorePanel.cpp b/main/source/cl_dll/vgui_ScorePanel.cpp index 3d8c34f7..d885a3a2 100644 --- a/main/source/cl_dll/vgui_ScorePanel.cpp +++ b/main/source/cl_dll/vgui_ScorePanel.cpp @@ -91,6 +91,8 @@ extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS+1]; // additional player in team_info_t g_TeamInfo[MAX_TEAMS+1]; int g_IsSpectator[MAX_PLAYERS+1]; +extern cvar_t* cl_teamcfgs; + int HUD_IsGame( const char *game ); int EV_TFC_IsAllyTeam( int iTeam1, int iTeam2 ); @@ -599,10 +601,14 @@ void ScorePanel::SortTeams() SortActivePlayers(kAlien2Team); SortActivePlayers(kMarine2Team); - if (oldteam != gHUD.GetHUDTeam()) + if (m_iPlayerTeam != gHUD.GetHUDTeam()) { - ClientCmd("exec alienofficial.cfg\n"); - oldteam = gHUD.GetHUDTeam(); + m_iPlayerTeam = gHUD.GetHUDTeam(); + + if ((cl_teamcfgs->value == 1.0f && gHUD.GetPlayMode() == PLAYMODE_PLAYING) || cl_teamcfgs->value >= 2.0f) + { + ClientCmd("exec alienofficial.cfg\n"); + } } } else { @@ -611,10 +617,14 @@ void ScorePanel::SortTeams() SortActivePlayers(kMarine2Team); SortActivePlayers(kAlien2Team); - if (oldteam != gHUD.GetHUDTeam()) + if (m_iPlayerTeam != gHUD.GetHUDTeam()) { - ClientCmd("exec marineofficial.cfg\n"); - oldteam = gHUD.GetHUDTeam(); + m_iPlayerTeam = gHUD.GetHUDTeam(); + + if ((cl_teamcfgs->value == 1.0f && gHUD.GetPlayMode() == PLAYMODE_PLAYING) || cl_teamcfgs->value >= 2.0f) + { + ClientCmd("exec marineofficial.cfg\n"); + } } } diff --git a/main/source/cl_dll/vgui_ScorePanel.h b/main/source/cl_dll/vgui_ScorePanel.h index 91e36cb3..1f264c49 100644 --- a/main/source/cl_dll/vgui_ScorePanel.h +++ b/main/source/cl_dll/vgui_ScorePanel.h @@ -102,7 +102,7 @@ private: unsigned int m_iIconFrame; unsigned int m_iLastFrameIncrementTime; - int oldteam; + int m_iPlayerTeam; public: