diff options
author | Ladislav Zezula <zezula@volny.cz> | 2024-12-04 09:16:28 +0100 |
---|---|---|
committer | Ladislav Zezula <zezula@volny.cz> | 2024-12-04 09:16:28 +0100 |
commit | d1bf5e1c71af432ccc24371a3611dc33edb7361f (patch) | |
tree | b4c37708fd47b0a715843cfda0aac11f2cca5a1e /src/SFileOpenFileEx.cpp | |
parent | e10150c8c389e6cd2ce41f88a3c0331ed499fb81 (diff) |
Changed behavior of patched files with MPQ_FLAG_DELETE_MARKER
Diffstat (limited to 'src/SFileOpenFileEx.cpp')
-rw-r--r-- | src/SFileOpenFileEx.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/SFileOpenFileEx.cpp b/src/SFileOpenFileEx.cpp index 90c7fab..2954669 100644 --- a/src/SFileOpenFileEx.cpp +++ b/src/SFileOpenFileEx.cpp @@ -155,6 +155,14 @@ bool OpenPatchedFile(HANDLE hMpq, const char * szFileName, HANDLE * PtrFile) hf = hfPatch; } } + + // If the opened file has the delete marker, we don't open the file + if(hfBase && hf && hf->pFileEntry->dwFlags & MPQ_FILE_DELETE_MARKER) + { + SFileCloseFile((HANDLE)(hfBase)); + SetLastError(ERROR_FILE_DELETED); + hfBase = NULL; + } } } else |