diff options
author | Ladislav Zezula <E:\Ladik\Mail> | 2015-11-07 23:04:44 +0100 |
---|---|---|
committer | Ladislav Zezula <E:\Ladik\Mail> | 2015-11-07 23:04:44 +0100 |
commit | dae6c5e315445b0c25d6a500deb7e7e625d8df90 (patch) | |
tree | ea2c745ca2633a13fb859277ec73dc690a2565e4 /src | |
parent | 18dda26660660e7ceaf18524e3d5e3d611df8f20 (diff) |
+ Hashing function no longer replaces slashes for backslashes (storm.dll v 2002 doesn't do that either)
+ Support for names beginning with slashes, like \/\BTNThoriumAmmunition.blp
Diffstat (limited to 'src')
-rw-r--r-- | src/SFileCreateArchive.cpp | 2 | ||||
-rw-r--r-- | src/SFileFindFile.cpp | 2 | ||||
-rw-r--r-- | src/SFileOpenArchive.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/SFileCreateArchive.cpp b/src/SFileCreateArchive.cpp index fb9ed60..df32759 100644 --- a/src/SFileCreateArchive.cpp +++ b/src/SFileCreateArchive.cpp @@ -202,7 +202,7 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea if(nError == ERROR_SUCCESS) { memset(ha, 0, sizeof(TMPQArchive)); - ha->pfnHashString = HashString; + ha->pfnHashString = HashStringSlash; ha->pStream = pStream; ha->dwSectorSize = pCreateInfo->dwSectorSize; ha->UserDataPos = MpqPos; diff --git a/src/SFileFindFile.cpp b/src/SFileFindFile.cpp index aacba12..41f31e1 100644 --- a/src/SFileFindFile.cpp +++ b/src/SFileFindFile.cpp @@ -138,7 +138,7 @@ static bool FileWasFoundBefore( }
// Calculate the hash to the table
- dwNameHash = HashString(szRealFileName, MPQ_HASH_NAME_A);
+ dwNameHash = ha->pfnHashString(szRealFileName, MPQ_HASH_NAME_A);
dwStartIndex = dwIndex = (dwNameHash % hs->dwSearchTableItems);
// The file might have been found before
diff --git a/src/SFileOpenArchive.cpp b/src/SFileOpenArchive.cpp index a951d39..f9469fb 100644 --- a/src/SFileOpenArchive.cpp +++ b/src/SFileOpenArchive.cpp @@ -215,7 +215,7 @@ bool WINAPI SFileOpenArchive( bool bSearchComplete = false; memset(ha, 0, sizeof(TMPQArchive)); - ha->pfnHashString = HashString; + ha->pfnHashString = HashStringSlash; ha->pStream = pStream; pStream = NULL; |