diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 572c31569..b6d77eb51 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -2157,7 +2157,7 @@ int CMenus::Render() static int s_ButtonTryAgain = 0; if(DoButton_Menu(&s_ButtonTryAgain, Localize("Yes"), !m_aSaveSkinName[0], &Yes) || m_EnterPressed) { - if(m_aSaveSkinName[0]) + if(m_aSaveSkinName[0] && m_aSaveSkinName[0] != 'x' && m_aSaveSkinName[1] != '_') { m_Popup = POPUP_NONE; SaveSkinfile(); diff --git a/src/game/client/components/skins.cpp b/src/game/client/components/skins.cpp index 91265ef11..05eedffe8 100644 --- a/src/game/client/components/skins.cpp +++ b/src/game/client/components/skins.cpp @@ -126,6 +126,9 @@ int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser) // init CSkin Skin = pSelf->m_DummySkin; + str_copy(Skin.m_aName, pName, min((int)sizeof(Skin.m_aName),l-4)); + if(pSelf->Find(Skin.m_aName, true) != -1) + return 0; bool SpecialSkin = pName[0] == 'x' && pName[1] == '_'; // parse json data @@ -200,7 +203,6 @@ int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser) Skin.m_Flags = SpecialSkin ? SKINFLAG_SPECIAL : 0; if(DirType != IStorage::TYPE_SAVE) Skin.m_Flags |= SKINFLAG_STANDARD; - str_copy(Skin.m_aName, pName, min((int)sizeof(Skin.m_aName),l-4)); if(g_Config.m_Debug) { str_format(aBuf, sizeof(aBuf), "load skin %s", Skin.m_aName);