Skip to content

Commit

Permalink
Abort linking when loading specified zone failed due to missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Laupetin committed Oct 5, 2023
1 parent 479b1d1 commit e7f52e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Linker/Linker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,22 +536,22 @@ 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();

auto zone = std::unique_ptr<Zone>(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));
Expand Down

0 comments on commit e7f52e5

Please sign in to comment.