mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed that the client crashes if it has no skins
This commit is contained in:
parent
f8b1edca64
commit
eedaf62d97
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue