aboutsummaryrefslogtreecommitdiff
path: root/src/SBaseFileTable.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <ladislav.zezula@avast.com>2022-02-12 21:14:55 +0100
committerLadislav Zezula <ladislav.zezula@avast.com>2022-02-12 21:14:55 +0100
commit6a107601c628ec15b5d7947d6f51d00d709b0e7a (patch)
tree9bb2210e70c0f86729e1bddb8b2228645a2764a8 /src/SBaseFileTable.cpp
parent7359c07c4658d0406658914f4c0458260fc976a7 (diff)
Fixed regression tests
Diffstat (limited to 'src/SBaseFileTable.cpp')
-rw-r--r--src/SBaseFileTable.cpp33
1 files changed, 5 insertions, 28 deletions
diff --git a/src/SBaseFileTable.cpp b/src/SBaseFileTable.cpp
index bcbc5e1..1b79243 100644
--- a/src/SBaseFileTable.cpp
+++ b/src/SBaseFileTable.cpp
@@ -885,28 +885,6 @@ static TMPQHash * DefragmentHashTable(
}
*/
-static void DeleteInvalidHashTableEntries(TMPQArchive * ha, TMPQHash * pHashTable, TMPQBlock * pBlockTable)
-{
- TMPQHeader * pHeader = ha->pHeader;
- TMPQHash * pHashTableEnd = pHashTable + pHeader->dwHashTableSize;
- TMPQHash * pHash = pHashTable;
-
- // Sanity checks
- assert(pHeader->wFormatVersion == MPQ_FORMAT_VERSION_1);
- assert(pHeader->HiBlockTablePos64 == 0);
-
- // Parse the hash table and move the entries to the begin of it
- for(pHash = pHashTable; pHash < pHashTableEnd; pHash++)
- {
- // Check whether this is a valid hash table entry
- if(!IsValidHashEntry1(ha, pHash, pBlockTable))
- {
- memset(pHash, 0xFF, sizeof(TMPQHash));
- pHash->dwBlockIndex = HASH_ENTRY_DELETED;
- }
- }
-}
-
static DWORD BuildFileTableFromBlockTable(
TMPQArchive * ha,
TMPQBlock * pBlockTable)
@@ -936,12 +914,11 @@ static DWORD BuildFileTableFromBlockTable(
// Example MPQ: MPQ_2022_v1_Sniper.scx
//
- if(ha->dwFlags & MPQ_FLAG_HASH_TABLE_CUT)
- {
- //ha->pHashTable = DefragmentHashTable(ha, ha->pHashTable, pBlockTable);
- //ha->dwMaxFileCount = pHeader->dwHashTableSize;
- DeleteInvalidHashTableEntries(ha, ha->pHashTable, pBlockTable);
- }
+ //if(ha->dwFlags & MPQ_FLAG_HASH_TABLE_CUT)
+ //{
+ // ha->pHashTable = DefragmentHashTable(ha, ha->pHashTable, pBlockTable);
+ // ha->dwMaxFileCount = pHeader->dwHashTableSize;
+ //}
// If the hash table or block table is cut,
// we will defragment the block table