fixed that the client crashes if it has no skins

This commit is contained in:
oy 2011-01-06 22:55:57 +01:00
parent f8b1edca64
commit eedaf62d97
2 changed files with 10 additions and 2 deletions

View file

@ -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()

View file

@ -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