diff --git a/Source/mpqapi.cpp b/Source/mpqapi.cpp index 810a920da..814fccc21 100644 --- a/Source/mpqapi.cpp +++ b/Source/mpqapi.cpp @@ -574,28 +574,20 @@ void CloseMPQ(const char *pszArchive, BOOL bFree, int dwChar) void mpqapi_store_modified_time(const char *pszArchive, int dwChar) { - int v2; // esi - const char *v3; // ebx - HANDLE v4; // eax - int v5; // esi - struct _WIN32_FIND_DATAA FindFileData; // [esp+8h] [ebp-1E0h] - char dst[160]; // [esp+148h] [ebp-A0h] + HANDLE handle; + struct _WIN32_FIND_DATAA FindFileData; + char dst[160]; - v2 = dwChar; - v3 = pszArchive; if (gbMaxPlayers != 1) { mpqapi_reg_load_modification_time(dst, 160); - v4 = FindFirstFile(v3, &FindFileData); - if (v4 != INVALID_HANDLE_VALUE) { - FindClose(v4); - v5 = 16 * v2; - *(_DWORD *)&dst[v5 + 8] = FindFileData.ftLastWriteTime.dwLowDateTime; - *(_DWORD *)&dst[v5 + 12] = FindFileData.ftLastWriteTime.dwHighDateTime; + handle = FindFirstFile(pszArchive, &FindFileData); + if (handle != INVALID_HANDLE_VALUE) { + FindClose(handle); + *((FILETIME*) (dst) + dwChar * 2 + 1) = FindFileData.ftLastWriteTime; mpqapi_reg_store_modification_time(dst, 160); } } } -// 679660: using guessed type char gbMaxPlayers; void mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, int dwChar) {