about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-01-06 22:55:57 +0100
committeroy <Tom_Adams@web.de>2011-01-06 22:55:57 +0100
commiteedaf62d97d1100bc4bd3dda50bfcd0c3763e812 (patch)
treec321039fbebaae2584ae0d298c864e5863d7654b /src/game/client
parentf8b1edca646b14f5c7cbae71a2cd20d42c1fd705 (diff)
downloadzcatch-eedaf62d97d1100bc4bd3dda50bfcd0c3763e812.tar.gz
zcatch-eedaf62d97d1100bc4bd3dda50bfcd0c3763e812.zip
fixed that the client crashes if it has no skins
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/components/skins.cpp10
-rw-r--r--src/game/client/gameclient.cpp2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/game/client/components/skins.cpp b/src/game/client/components/skins.cpp
index 16135164..d89d0647 100644
--- a/src/game/client/components/skins.cpp
+++ b/src/game/client/components/skins.cpp
@@ -118,6 +118,16 @@ void CSkins::Init()
 	// load skins
 	m_aSkins.clear();
 	Storage()->ListDirectory(IStorage::TYPE_ALL, "skins", SkinScan, this);
+	if(!m_aSkins.size())
+	{
+		Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load skins. folder='skins/'");
+		CSkin DummySkin;
+		DummySkin.m_OrgTexture = -1;
+		DummySkin.m_ColorTexture = -1;
+		str_copy(DummySkin.m_aName, "dummy", sizeof(DummySkin.m_aName));
+		DummySkin.m_BloodColor = vec3(1.0f, 1.0f, 1.0f);
+		m_aSkins.add(DummySkin);
+	}
 }
 
 int CSkins::Num()
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index 84ca77b1..45bd7ae3 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -266,8 +266,6 @@ void CGameClient::OnInit()
 
 	// load skins
 	::gs_Skins.Init();
-	if(!::gs_Skins.Num())
-		Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load skins. folder='skins/'");
 	
 	// TODO: Refactor: fix threaded loading of sounds again
 	// load sounds