More fixes
This commit is contained in:
parent
c5c11a5a40
commit
bf3c3bdccc
|
@ -135,6 +135,7 @@ void mod_cache_save(void) {
|
||||||
FILE* fp = fopen(filename, "wb");
|
FILE* fp = fopen(filename, "wb");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
LOG_ERROR("Failed to open mod cache save fp: %s", filename);
|
LOG_ERROR("Failed to open mod cache save fp: %s", filename);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 version = MOD_CACHE_VERSION;
|
u16 version = MOD_CACHE_VERSION;
|
||||||
|
@ -143,7 +144,7 @@ void mod_cache_save(void) {
|
||||||
struct ModCacheEntry* node = sModCacheHead;
|
struct ModCacheEntry* node = sModCacheHead;
|
||||||
while (node != NULL) {
|
while (node != NULL) {
|
||||||
fwrite(node->dataHash, sizeof(u8), 16, fp);
|
fwrite(node->dataHash, sizeof(u8), 16, fp);
|
||||||
fwrite(node->lastLoaded, sizeof(u64), 1, fp);
|
fwrite(&node->lastLoaded, sizeof(u64), 1, fp);
|
||||||
u16 pathLen = strlen(node->path);
|
u16 pathLen = strlen(node->path);
|
||||||
fwrite(&pathLen, sizeof(u16), 1, fp);
|
fwrite(&pathLen, sizeof(u16), 1, fp);
|
||||||
fwrite(node->path, sizeof(u8), pathLen + 1, fp);
|
fwrite(node->path, sizeof(u8), pathLen + 1, fp);
|
||||||
|
|
|
@ -61,7 +61,7 @@ static void mark_groups_loaded_from_hash(void) {
|
||||||
if (mod->loadedFromCache) {
|
if (mod->loadedFromCache) {
|
||||||
// if we loaded from cache, mark bytes as downloaded
|
// if we loaded from cache, mark bytes as downloaded
|
||||||
sTotalDownloadBytes += mod->size;
|
sTotalDownloadBytes += mod->size;
|
||||||
LOG_INFO("Loaded from cache: %s, %llu", mod->name, mod->size);
|
LOG_INFO("Loaded from cache: %s, %llu", mod->name, (u64)mod->size);
|
||||||
} else {
|
} else {
|
||||||
// if we haven't loaded from cache, we need this offset group
|
// if we haven't loaded from cache, we need this offset group
|
||||||
u64 ogIndexStart = fileStartOffset / GROUP_SIZE;
|
u64 ogIndexStart = fileStartOffset / GROUP_SIZE;
|
||||||
|
|
Loading…
Reference in New Issue