From bf3c3bdccc65cc4704cd4c0c4b7a0f6dfed54dfd Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 12 Apr 2022 19:39:48 -0700 Subject: [PATCH] More fixes --- src/pc/mods/mod_cache.c | 3 ++- src/pc/network/packets/packet_download.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pc/mods/mod_cache.c b/src/pc/mods/mod_cache.c index 414fb8127..e94f6eb41 100644 --- a/src/pc/mods/mod_cache.c +++ b/src/pc/mods/mod_cache.c @@ -135,6 +135,7 @@ void mod_cache_save(void) { FILE* fp = fopen(filename, "wb"); if (fp == NULL) { LOG_ERROR("Failed to open mod cache save fp: %s", filename); + return; } u16 version = MOD_CACHE_VERSION; @@ -143,7 +144,7 @@ void mod_cache_save(void) { struct ModCacheEntry* node = sModCacheHead; while (node != NULL) { 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); fwrite(&pathLen, sizeof(u16), 1, fp); fwrite(node->path, sizeof(u8), pathLen + 1, fp); diff --git a/src/pc/network/packets/packet_download.c b/src/pc/network/packets/packet_download.c index 403907f0c..2dcd7a158 100644 --- a/src/pc/network/packets/packet_download.c +++ b/src/pc/network/packets/packet_download.c @@ -61,7 +61,7 @@ static void mark_groups_loaded_from_hash(void) { if (mod->loadedFromCache) { // if we loaded from cache, mark bytes as downloaded 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 { // if we haven't loaded from cache, we need this offset group u64 ogIndexStart = fileStartOffset / GROUP_SIZE;