From d1b47ab454e9f20589c6b47c78e5875e19888cdf Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Sat, 26 Mar 2022 19:34:34 +0100 Subject: Big endian fixes --- src/SBaseCommon.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/SBaseCommon.cpp') diff --git a/src/SBaseCommon.cpp b/src/SBaseCommon.cpp index 1209719..f90c009 100644 --- a/src/SBaseCommon.cpp +++ b/src/SBaseCommon.cpp @@ -1926,7 +1926,7 @@ void ConvertTMPQHeader(void *header, uint16_t version) TMPQHeader * theHeader = (TMPQHeader *)header; // Swap header part version 1 - if(version == MPQ_FORMAT_VERSION_1) + if(version >= MPQ_FORMAT_VERSION_1) { theHeader->dwID = SwapUInt32(theHeader->dwID); theHeader->dwHeaderSize = SwapUInt32(theHeader->dwHeaderSize); @@ -1939,21 +1939,21 @@ void ConvertTMPQHeader(void *header, uint16_t version) theHeader->dwBlockTableSize = SwapUInt32(theHeader->dwBlockTableSize); } - if(version == MPQ_FORMAT_VERSION_2) + if(version >= MPQ_FORMAT_VERSION_2) { theHeader->HiBlockTablePos64 = SwapUInt64(theHeader->HiBlockTablePos64); theHeader->wHashTablePosHi = SwapUInt16(theHeader->wHashTablePosHi); theHeader->wBlockTablePosHi = SwapUInt16(theHeader->wBlockTablePosHi); } - if(version == MPQ_FORMAT_VERSION_3) + if(version >= MPQ_FORMAT_VERSION_3) { theHeader->ArchiveSize64 = SwapUInt64(theHeader->ArchiveSize64); theHeader->BetTablePos64 = SwapUInt64(theHeader->BetTablePos64); theHeader->HetTablePos64 = SwapUInt64(theHeader->HetTablePos64); } - if(version == MPQ_FORMAT_VERSION_4) + if(version >= MPQ_FORMAT_VERSION_4) { theHeader->HashTableSize64 = SwapUInt64(theHeader->HashTableSize64); theHeader->BlockTableSize64 = SwapUInt64(theHeader->BlockTableSize64); -- cgit v1.2.3