mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
DataCache: improve FindUncachedMDL error handling
Just use a single branch.
This commit is contained in:
parent
0578ba6bba
commit
1fe426fb65
@ -182,34 +182,22 @@ studiohdr_t* CMDLCache::FindUncachedMDL(CMDLCache* const cache, const MDLHandle_
|
||||
FindCachedMDL(cache, pStudioData, a4);
|
||||
studiomodelcache_t* const modelCache = pStudioData->GetModelCache();
|
||||
|
||||
if (modelCache)
|
||||
{
|
||||
if (modelCache == DC_INVALID_HANDLE)
|
||||
{
|
||||
studioHdr = GetErrorModel();
|
||||
if (!IsKnownBadModel(handle))
|
||||
{
|
||||
if (!studioHdr)
|
||||
Error(eDLL_T::ENGINE, EXIT_FAILURE, "Model \"%s\" has bad studio data and \"%s\" couldn't be loaded.\n", modelName, ERROR_MODEL);
|
||||
else
|
||||
Error(eDLL_T::ENGINE, NO_ERROR, "Model \"%s\" has bad studio data; replacing with \"%s\".\n", modelName, ERROR_MODEL);
|
||||
}
|
||||
}
|
||||
else
|
||||
studioHdr = modelCache->GetStudioHdr();
|
||||
}
|
||||
else
|
||||
if (IS_VALID_DATACACHE_HANDLE(modelCache))
|
||||
{
|
||||
studioHdr = GetErrorModel();
|
||||
|
||||
if (!IsKnownBadModel(handle))
|
||||
{
|
||||
if (!studioHdr)
|
||||
Error(eDLL_T::ENGINE, EXIT_FAILURE, "Model \"%s\" has no studio data and \"%s\" couldn't be loaded.\n", modelName, ERROR_MODEL);
|
||||
Error(eDLL_T::ENGINE, EXIT_FAILURE, "Model \"%s\" has invalid studio data and \"%s\" couldn't be loaded.\n", modelName, ERROR_MODEL);
|
||||
else
|
||||
Error(eDLL_T::ENGINE, NO_ERROR, "Model \"%s\" has no studio data; replacing with \"%s\".\n", modelName, ERROR_MODEL);
|
||||
Error(eDLL_T::ENGINE, NO_ERROR, "Model \"%s\" has invalid studio data; replacing with \"%s\".\n", modelName, ERROR_MODEL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
studioHdr = modelCache->GetStudioHdr();
|
||||
}
|
||||
}
|
||||
|
||||
assert(studioHdr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user