ARKCORE中在解压国服4.32 build 14250时, 提示错误read map.dbc file... fatal error:Invalid map.dbc file format
经过研究, 发现MPQ.cpp文件中 函数中char* ExtractFileToMemory(HANDLE &MPQ_handle, const char * szArchivedFile, int & size )
有bug。
// Get the size of the full patched file
size = SFileGetFileSize(hFile, NULL);
if (size != 0)
{
// Allocate space for the full file
pbFullFile = new char[size];
if (!SFileReadFile(hFile, pbFullFile, size))
{
nError = GetLastError();
printf("Failed to read full patched file data \"%s\"\n", szArchivedFile);
assert(false);
}
文件指针没有移动到最开始的位置。
修改之后的代码:
// Get the size of the full patched file
size = SFileGetFileSize(hFile, NULL);
if (size != 0)
{
//添加如下3行
LONG new_pos = 0;
DWORD ret = 0;
ret = SFileSetFilePointer(hFile, 0, &new_pos, FILE_BEGIN);
//
// Allocate space for the full file
pbFullFile = new char[size];
if (!SFileReadFile(hFile, pbFullFile, size))
{
nError = GetLastError();
printf("Failed to read full patched file data \"%s\"\n", szArchivedFile);
assert(false);
}
在map.cpp文件中,找到函数void ExtractMapsFromMpq(uint32 build)
在 LoadMapMPQFiles();上一行添加LoadLocaleMPQFiles(6);
重新编译既可