diff --git a/src/asset_manager.c b/src/asset_manager.c index c1e5d08..1bca82c 100644 --- a/src/asset_manager.c +++ b/src/asset_manager.c @@ -85,7 +85,10 @@ bool asset_manager_load_archive(enum asset_type type, const char *archive_name) return false; if (!assets[type]->load_archive) ERROR("load_archive not supported on this archive type"); - return assets[type]->load_archive(assets[type], archive_name); + char *path = gamedir_path(archive_name); + bool r = assets[type]->load_archive(assets[type], path); + free(path); + return r; } bool asset_exists(enum asset_type type, int id) diff --git a/src/hll/CGManager.c b/src/hll/CGManager.c index 585e3d8..36ef67b 100644 --- a/src/hll/CGManager.c +++ b/src/hll/CGManager.c @@ -17,7 +17,6 @@ #include "system4/cg.h" #include "system4/string.h" #include "asset_manager.h" -#include "xsystem4.h" #include "hll.h" static bool CGManager_Init(void *imain_system, int cg_cache_size) @@ -27,10 +26,7 @@ static bool CGManager_Init(void *imain_system, int cg_cache_size) static bool CGManager_LoadArchive(struct string *archive_name) { - char *name = gamedir_path(archive_name->text); - bool r = asset_manager_load_archive(ASSET_CG, name); - free(name); - return r; + return asset_manager_load_archive(ASSET_CG, archive_name->text); } static bool CGManager_IsExist(struct string *cg_name)