From eedaf62d97d1100bc4bd3dda50bfcd0c3763e812 Mon Sep 17 00:00:00 2001 From: oy Date: Thu, 6 Jan 2011 22:55:57 +0100 Subject: fixed that the client crashes if it has no skins --- src/game/client/components/skins.cpp | 10 ++++++++++ src/game/client/gameclient.cpp | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit 1.4.1