mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 14:55:51 -04:00
jak3: fix hud sprite crash + add entity debugger (#3516)
This commit is contained in:
@@ -28,25 +28,9 @@ namespace decompiler {
|
||||
std::optional<ObjectFileRecord> get_bsp_file(const std::vector<ObjectFileRecord>& records,
|
||||
const std::string& dgo_name) {
|
||||
std::optional<ObjectFileRecord> result;
|
||||
bool found = false;
|
||||
for (auto& file : records) {
|
||||
if (file.name.length() > 4 && file.name.substr(file.name.length() - 4) == "-vis") {
|
||||
ASSERT(!found);
|
||||
found = true;
|
||||
result = file;
|
||||
}
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
if (str_util::ends_with(dgo_name, ".DGO") || str_util::ends_with(dgo_name, ".CGO")) {
|
||||
auto expected_name = dgo_name.substr(0, dgo_name.length() - 4);
|
||||
for (auto& c : expected_name) {
|
||||
c = tolower(c);
|
||||
}
|
||||
if (!records.empty() && expected_name == records.back().name) {
|
||||
return records.back();
|
||||
}
|
||||
}
|
||||
if (str_util::ends_with(dgo_name, ".DGO")) {
|
||||
// only DGOs are valid levels, and the last file is the bsp file
|
||||
result = records.at(records.size() - 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user