Skip to content

Commit

Permalink
Synchronize changes from 1.6 master branch [ci skip]
Browse files Browse the repository at this point in the history
2846e27 Fix file check in CResource (Fixes #3201, PR #3202)
  • Loading branch information
github-actions[bot] committed Oct 8, 2023
2 parents 072f5a6 + 2846e27 commit fd2617c
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Server/mods/deathmatch/logic/CResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,31 +602,31 @@ bool CResource::HasResourceChanged()

for (CResourceFile* pResourceFile : m_ResourceFiles)
{
if (GetFilePath(pResourceFile->GetName(), strPath))
{
CChecksum checksum = CChecksum::GenerateChecksumFromFileUnsafe(strPath);
if (!GetFilePath(pResourceFile->GetName(), strPath))
return true;

if (pResourceFile->GetLastChecksum() != checksum)
return true;
CChecksum checksum = CChecksum::GenerateChecksumFromFileUnsafe(strPath);

// Also check if file in http cache has been externally altered
switch (pResourceFile->GetType())
if (pResourceFile->GetLastChecksum() != checksum)
return true;

// Also check if file in http cache has been externally altered
switch (pResourceFile->GetType())
{
case CResourceFile::RESOURCE_FILE_TYPE_CLIENT_SCRIPT:
case CResourceFile::RESOURCE_FILE_TYPE_CLIENT_CONFIG:
case CResourceFile::RESOURCE_FILE_TYPE_CLIENT_FILE:
{
case CResourceFile::RESOURCE_FILE_TYPE_CLIENT_SCRIPT:
case CResourceFile::RESOURCE_FILE_TYPE_CLIENT_CONFIG:
case CResourceFile::RESOURCE_FILE_TYPE_CLIENT_FILE:
{
string strCachedFilePath = pResourceFile->GetCachedPathFilename();
CChecksum cachedChecksum = CChecksum::GenerateChecksumFromFileUnsafe(strCachedFilePath);
string strCachedFilePath = pResourceFile->GetCachedPathFilename();
CChecksum cachedChecksum = CChecksum::GenerateChecksumFromFileUnsafe(strCachedFilePath);

if (cachedChecksum != checksum)
return true;
if (cachedChecksum != checksum)
return true;

break;
}
default:
break;
break;
}
default:
break;
}
}

Expand Down

0 comments on commit fd2617c

Please sign in to comment.