From 6871a3a067196ea00f311dfdf03079bf4f2e58c6 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Mon, 31 Mar 2025 15:40:25 -0400 Subject: [PATCH] goalc: don't assume DGO/CGOs are within the ObjectDB when building levels (#3888) Follow-up later on improving the validation of the extractor (that may require testing with all iso versions), but this is just some simple safe-guarding code that will improve the error messaging, instead of just a vague invalid map error. ![Screenshot 2025-03-30 165334](https://github.com/user-attachments/assets/a195d248-4ed5-4c02-80f4-4170d3ff1e48) --- .vs/launch.vs.json | 2 +- goalc/build_level/jak1/build_level.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json index 801a04453d..b88abb0e5c 100644 --- a/.vs/launch.vs.json +++ b/.vs/launch.vs.json @@ -381,7 +381,7 @@ "projectTarget": "extractor.exe (bin\\extractor.exe)", "name": "Tools - Extractor - Full", "args": [ - "\"E:\\ISOs\\Jak\\Jak 1.iso\"" + "D:\\ISOs\\Jak\\Temp\\bad.iso" ] }, { diff --git a/goalc/build_level/jak1/build_level.cpp b/goalc/build_level/jak1/build_level.cpp index e3051f2b36..f1bc5c77d4 100644 --- a/goalc/build_level/jak1/build_level.cpp +++ b/goalc/build_level/jak1/build_level.cpp @@ -191,6 +191,9 @@ bool run_build_level(const std::string& input_file, for (auto& dgo : config.dgo_names) { // remove "DGO/" prefix const auto& dgo_name = dgo.substr(4); + ASSERT_MSG( + db.obj_files_by_dgo.contains(dgo_name), + fmt::format("{} DGO expected to be part of the ObjectDB but it is not!", dgo_name)); const auto& files = db.obj_files_by_dgo.at(dgo_name); auto art_groups = find_art_groups(processed_art_groups,