Abort linking when loading specified zone failed due to missing file

This commit is contained in:
Jan 2023-10-05 20:29:38 +02:00
parent 479b1d1836
commit e7f52e5dc7

View File

@ -536,8 +536,8 @@ class Linker::Impl
{ {
if (!fs::is_regular_file(zonePath)) if (!fs::is_regular_file(zonePath))
{ {
printf("Could not find file \"%s\".\n", zonePath.c_str()); std::cout << "Could not find zone file to load \"" << zonePath << "\".\n";
continue; return false;
} }
auto absoluteZoneDirectory = absolute(std::filesystem::path(zonePath).remove_filename()).string(); auto absoluteZoneDirectory = absolute(std::filesystem::path(zonePath).remove_filename()).string();
@ -545,13 +545,13 @@ class Linker::Impl
auto zone = std::unique_ptr<Zone>(ZoneLoading::LoadZone(zonePath)); auto zone = std::unique_ptr<Zone>(ZoneLoading::LoadZone(zonePath));
if (zone == nullptr) if (zone == nullptr)
{ {
printf("Failed to load zone \"%s\".\n", zonePath.c_str()); std::cout << "Failed to load zone \"" << zonePath << "\".\n";
return false; return false;
} }
if (m_args.m_verbose) 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)); m_loaded_zones.emplace_back(std::move(zone));