From 15b78f966d272c89f2525cbb231782da56255002 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 25 Jun 2023 02:31:50 +0200 Subject: [PATCH] Fix unreachable code in CMDLCache This code was part of an invalid string check, but is no longer necessary and was causing the unreachable code bug. Removed. --- r5dev/datacache/mdlcache.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/r5dev/datacache/mdlcache.cpp b/r5dev/datacache/mdlcache.cpp index b7b9a33d..09296593 100644 --- a/r5dev/datacache/mdlcache.cpp +++ b/r5dev/datacache/mdlcache.cpp @@ -143,18 +143,6 @@ studiohdr_t* CMDLCache::FindUncachedMDL(CMDLCache* cache, MDLHandle_t handle, st pStudioData->m_Mutex.WaitForLock(); const char* szModelName = cache->GetModelName(handle); - pStudioHdr = GetErrorModel(); - if (!IsKnownBadModel(handle)) - { - if (!pStudioHdr) - Error(eDLL_T::ENGINE, EXIT_FAILURE, "Model with handle \"%hu\" not found and \"%s\" couldn't be loaded.\n", handle, ERROR_MODEL); - else - Error(eDLL_T::ENGINE, NO_ERROR, "Model with handle \"%hu\" not found; replacing with \"%s\".\n", handle, ERROR_MODEL); - } - - pStudioData->m_Mutex.ReleaseWaiter(); - return pStudioHdr; - size_t nFileNameLen = strlen(szModelName); if (nFileNameLen < 5 || @@ -232,6 +220,7 @@ studiohdr_t* CMDLCache::FindUncachedMDL(CMDLCache* cache, MDLHandle_t handle, st } } } + pStudioData->m_Mutex.ReleaseWaiter(); return pStudioHdr; }