aboutsummaryrefslogtreecommitdiff
path: root/src/SFileOpenArchive.cpp
diff options
context:
space:
mode:
authorLadislav <Zezula>2013-10-11 21:40:00 +0200
committerLadislav <Zezula>2013-10-11 21:40:00 +0200
commitc59aa13d57bbd0adf6662ef3266a3943c7e5960f (patch)
treee4983e25b5b3f708e64b22608cc5d86abcc516ff /src/SFileOpenArchive.cpp
parent38655d66d94f958402ce65380f5373c7245c8e55 (diff)
+ (Perhaps) finally updated ZLIB so the fucking GIT will not downgrade it on next pull
+ Dmitry Vortex issues
Diffstat (limited to 'src/SFileOpenArchive.cpp')
-rw-r--r--src/SFileOpenArchive.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/SFileOpenArchive.cpp b/src/SFileOpenArchive.cpp
index 873d33f..97b2b05 100644
--- a/src/SFileOpenArchive.cpp
+++ b/src/SFileOpenArchive.cpp
@@ -178,6 +178,9 @@ bool WINAPI SFileOpenArchive(
// Initialize handle structure and allocate structure for MPQ header
if(nError == ERROR_SUCCESS)
{
+ ULONGLONG SearchPos = 0;
+ DWORD dwHeaderID;
+
memset(ha, 0, sizeof(TMPQArchive));
ha->pStream = pStream;
pStream = NULL;
@@ -189,14 +192,8 @@ bool WINAPI SFileOpenArchive(
// Also remember if we shall check sector CRCs when reading file
if(dwFlags & MPQ_OPEN_CHECK_SECTOR_CRC)
ha->dwFlags |= MPQ_FLAG_CHECK_SECTOR_CRC;
- }
-
- // Find the offset of MPQ header within the file
- if(nError == ERROR_SUCCESS)
- {
- ULONGLONG SearchPos = 0;
- DWORD dwHeaderID;
+ // Find the offset of MPQ header within the file
while(SearchPos < FileSize)
{
DWORD dwBytesAvailable = MPQ_HEADER_SIZE_V4;