mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Optimize the finding of fallback models
Don't construct a new string, just test the mdl strings right away using 'V_ComparePath'.
This commit is contained in:
parent
dbb18e586d
commit
3391b1b1f0
@ -38,27 +38,15 @@ studiohdr_t* CMDLCache::FindMDL(CMDLCache* cache, MDLHandle_t handle, void* a3)
|
||||
{
|
||||
studiohdr_t* pStudioHDR = **reinterpret_cast<studiohdr_t***>(pStudioData);
|
||||
|
||||
if (!g_pMDLFallback->m_hErrorMDL)
|
||||
if (!g_pMDLFallback->m_hErrorMDL && V_ComparePath(pStudioHDR->name, ERROR_MODEL))
|
||||
{
|
||||
CUtlString studioPathFixed(pStudioHDR->name);
|
||||
studioPathFixed.FixSlashes(INCORRECT_PATH_SEPARATOR);
|
||||
|
||||
if (studioPathFixed.IsEqual_CaseInsensitive(ERROR_MODEL))
|
||||
{
|
||||
g_pMDLFallback->m_pErrorHDR = pStudioHDR;
|
||||
g_pMDLFallback->m_hErrorMDL = handle;
|
||||
}
|
||||
g_pMDLFallback->m_pErrorHDR = pStudioHDR;
|
||||
g_pMDLFallback->m_hErrorMDL = handle;
|
||||
}
|
||||
else if (!g_pMDLFallback->m_hEmptyMDL)
|
||||
else if (!g_pMDLFallback->m_hEmptyMDL && V_ComparePath(pStudioHDR->name, EMPTY_MODEL))
|
||||
{
|
||||
CUtlString studioPathFixed(pStudioHDR->name);
|
||||
studioPathFixed.FixSlashes(INCORRECT_PATH_SEPARATOR);
|
||||
|
||||
if (studioPathFixed.IsEqual_CaseInsensitive(EMPTY_MODEL))
|
||||
{
|
||||
g_pMDLFallback->m_pEmptyHDR = pStudioHDR;
|
||||
g_pMDLFallback->m_hEmptyMDL = handle;
|
||||
}
|
||||
g_pMDLFallback->m_pEmptyHDR = pStudioHDR;
|
||||
g_pMDLFallback->m_hEmptyMDL = handle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user