about summary refs log tree commit diff
path: root/src/game/client/gameclient.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-03-16 12:09:22 +0100
committeroy <Tom_Adams@web.de>2011-03-16 12:09:22 +0100
commit156e23b5923af300595704bb4fe6999deb4871a8 (patch)
tree47c20236a5bcc3493c795c3d6e638b2893ea0f49 /src/game/client/gameclient.cpp
parent30d9c9f4d9e46fec403f3fa810898017a18e93b6 (diff)
downloadzcatch-156e23b5923af300595704bb4fe6999deb4871a8.tar.gz
zcatch-156e23b5923af300595704bb4fe6999deb4871a8.zip
added loading/support for country flags to the client
Diffstat (limited to 'src/game/client/gameclient.cpp')
-rw-r--r--src/game/client/gameclient.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index b6e89a7b..15786110 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -26,6 +26,7 @@
 #include "components/chat.h"
 #include "components/console.h"
 #include "components/controls.h"
+#include "components/countryflags.h"
 #include "components/damageind.h"
 #include "components/debughud.h"
 #include "components/effects.h"
@@ -60,6 +61,7 @@ static CBinds gs_Binds;
 static CParticles gs_Particles;
 static CMenus gs_Menus;
 static CSkins gs_Skins;
+static CCountryFlags gs_CountryFlags;
 static CFlow gs_Flow;
 static CHud gs_Hud;
 static CDebugHud gs_DebugHud;
@@ -107,6 +109,7 @@ void CGameClient::OnConsoleInit()
 	m_pParticles = &::gs_Particles;
 	m_pMenus = &::gs_Menus;
 	m_pSkins = &::gs_Skins;
+	m_pCountryFlags = &::gs_CountryFlags;
 	m_pChat = &::gs_Chat;
 	m_pFlow = &::gs_Flow;
 	m_pCamera = &::gs_Camera;
@@ -121,6 +124,7 @@ void CGameClient::OnConsoleInit()
 	
 	// make a list of all the systems, make sure to add them in the corrent render order
 	m_All.Add(m_pSkins);
+	m_All.Add(m_pCountryFlags);
 	m_All.Add(m_pMapimages);
 	m_All.Add(m_pEffects); // doesn't render anything, just updates effects
 	m_All.Add(m_pParticles);
@@ -697,6 +701,15 @@ void CGameClient::OnNewSnapshot()
 				m_aClients[ClientID].m_UseCustomColor = pInfo->m_UseCustomColor;
 				m_aClients[ClientID].m_ColorBody = pInfo->m_ColorBody;
 				m_aClients[ClientID].m_ColorFeet = pInfo->m_ColorFeet;
+
+				// find country flag
+				m_aClients[ClientID].m_Country = g_GameClient.m_pCountryFlags->Find(m_aClients[ClientID].m_Country);
+				if(m_aClients[ClientID].m_Country < 0)
+				{
+					m_aClients[ClientID].m_Country = g_GameClient.m_pCountryFlags->Find(-1);
+					if(m_aClients[ClientID].m_Country < 0)
+						m_aClients[ClientID].m_Country = 0;
+				}
 				
 				// prepare the info
 				if(m_aClients[ClientID].m_aSkinName[0] == 'x' || m_aClients[ClientID].m_aSkinName[1] == '_')