关于ARKCORE 中extractor中read map.dbc file... fatal error:Invalid map.dbc file format!的解决

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);

重新编译既可


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值