Browse Source

Clean up mpqapi_new_block

pull/114/head
Anders Jenbo 7 years ago
parent
commit
46dfa53bf2
  1. 22
      Source/mpqapi.cpp

22
Source/mpqapi.cpp

@ -209,22 +209,24 @@ LABEL_2:
_BLOCKENTRY *mpqapi_new_block(int *block_index) _BLOCKENTRY *mpqapi_new_block(int *block_index)
{ {
_BLOCKENTRY *result; // eax _BLOCKENTRY *blockEntry;
unsigned int v2; // edx DWORD i;
result = sgpBlockTbl; blockEntry = sgpBlockTbl;
v2 = 0;
while (result->offset || result->sizealloc || result->flags || result->sizefile) { i = 0;
++v2; while (blockEntry->offset || blockEntry->sizealloc || blockEntry->flags || blockEntry->sizefile) {
++result; i++;
if (v2 >= 0x800) { blockEntry++;
if (i >= 2048) {
app_fatal("Out of free block entries"); app_fatal("Out of free block entries");
return 0; return 0;
} }
} }
if (block_index) if (block_index)
*block_index = v2; *block_index = i;
return result;
return blockEntry;
} }
int mpqapi_get_hash_index_of_path(const char *pszName) // FetchHandle int mpqapi_get_hash_index_of_path(const char *pszName) // FetchHandle

Loading…
Cancel
Save