[jak 2] merc (#2039)

This commit is contained in:
water111
2022-11-30 22:36:09 -05:00
committed by GitHub
parent ceebe3f7eb
commit 70e231fa72
113 changed files with 31406 additions and 974 deletions
+9 -2
View File
@@ -156,7 +156,7 @@ goos::Object decompile_at_label_guess_type(const DecompilerLabel& label,
GameVersion version) {
auto guessed_type = get_type_of_label(label, words);
if (!guessed_type.has_value()) {
throw std::runtime_error("Could not guess the type of " + label.name);
throw std::runtime_error("(1) Could not guess the type of " + label.name);
}
return decompile_at_label(*guessed_type, label, labels, words, ts, file, version);
}
@@ -1567,7 +1567,14 @@ goos::Object decompile_pair_elt(const LinkedWord& word,
auto& label = labels.at(word.label_id());
auto guessed_type = get_type_of_label(label, words);
if (!guessed_type.has_value()) {
throw std::runtime_error("Could not guess the type of " + label.name);
auto& info = file->label_db->lookup(label.name);
if (info.known) {
guessed_type = info.result_type;
}
}
if (!guessed_type.has_value()) {
throw std::runtime_error("(1) Could not guess the type of " + label.name);
}
if (guessed_type == TypeSpec("pair")) {