aboutsummaryrefslogtreecommitdiff
path: root/src/SFileAddFile.cpp
diff options
context:
space:
mode:
authorLadislav <Zezula>2014-03-27 17:21:38 +0100
committerLadislav <Zezula>2014-03-27 17:21:38 +0100
commit27631209d90b8863db06b4c81c7b21efb32f2f2d (patch)
treea8680e8c5c4262c514b25d129eb1cd0f1ddf6178 /src/SFileAddFile.cpp
parentc8db90a9c4dcf30b626861bfe6efeec818a78719 (diff)
+ Fixed crash when adding file after an empty archive has been flushed
Diffstat (limited to 'src/SFileAddFile.cpp')
-rw-r--r--src/SFileAddFile.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/SFileAddFile.cpp b/src/SFileAddFile.cpp
index 040ed57..f941141 100644
--- a/src/SFileAddFile.cpp
+++ b/src/SFileAddFile.cpp
@@ -434,6 +434,11 @@ int SFileAddFile_Init(
// If the caller didn't set MPQ_FILE_REPLACEEXISTING, fail it
if((dwFlags & MPQ_FILE_REPLACEEXISTING) == 0)
nError = ERROR_ALREADY_EXISTS;
+
+ // When replacing an existing file,
+ // we still need to invalidate the (attributes) file
+ if(nError == ERROR_SUCCESS)
+ InvalidateInternalFiles(ha);
}
}