From 479b1d183678cbbbdd4b508217994e8e544b2cb9 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 5 Oct 2023 20:19:49 +0200 Subject: [PATCH 1/2] Log asset name when not being able to create empty asset --- src/ObjLoading/AssetLoading/AssetLoadingManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ObjLoading/AssetLoading/AssetLoadingManager.cpp b/src/ObjLoading/AssetLoading/AssetLoadingManager.cpp index bc34497bb..e4fee2eef 100644 --- a/src/ObjLoading/AssetLoading/AssetLoadingManager.cpp +++ b/src/ObjLoading/AssetLoading/AssetLoadingManager.cpp @@ -60,7 +60,7 @@ XAssetInfoGeneric* AssetLoadingManager::LoadIgnoredDependency(const asset_type_t return lastDependency; } - std::cout << "Failed to create empty asset for type \"" << m_context.m_zone->m_pools->GetAssetTypeName(assetType) << "\"" << std::endl; + std::cout << "Failed to create empty asset \"" << assetName << "\" for type \"" << m_context.m_zone->m_pools->GetAssetTypeName(assetType) << "\"" << std::endl; return nullptr; } From e7f52e5dc73bb73b587627ea9b181cef0418fe59 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 5 Oct 2023 20:29:38 +0200 Subject: [PATCH 2/2] Abort linking when loading specified zone failed due to missing file --- src/Linker/Linker.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Linker/Linker.cpp b/src/Linker/Linker.cpp index 511b881bf..87d254224 100644 --- a/src/Linker/Linker.cpp +++ b/src/Linker/Linker.cpp @@ -536,8 +536,8 @@ class Linker::Impl { if (!fs::is_regular_file(zonePath)) { - printf("Could not find file \"%s\".\n", zonePath.c_str()); - continue; + std::cout << "Could not find zone file to load \"" << zonePath << "\".\n"; + return false; } auto absoluteZoneDirectory = absolute(std::filesystem::path(zonePath).remove_filename()).string(); @@ -545,13 +545,13 @@ class Linker::Impl auto zone = std::unique_ptr(ZoneLoading::LoadZone(zonePath)); if (zone == nullptr) { - printf("Failed to load zone \"%s\".\n", zonePath.c_str()); + std::cout << "Failed to load zone \"" << zonePath << "\".\n"; return false; } if (m_args.m_verbose) { - printf("Loaded zone \"%s\"\n", zone->m_name.c_str()); + std::cout << "Load zone \"" << zone->m_name << "\"\n"; } m_loaded_zones.emplace_back(std::move(zone));