fix incorrect exception type during item identification

This commit is contained in:
Martin Michelsen
2024-01-04 10:58:34 -08:00
parent c9d7fe1c2a
commit 7fc3cca11b
+8 -6
View File
@@ -1750,13 +1750,15 @@ ssize_t ItemCreator::apply_tekker_deltas(ItemData& item, uint8_t section_id) {
} else {
new_special = item.data1[4];
}
if ((new_special != item.data1[4]) &&
(this->item_parameter_table->get_special(item.data1[4]).type ==
this->item_parameter_table->get_special(new_special).type)) {
this->log.info("(Special) Delta canceled because it would change special category");
item.data1[4] = new_special;
if (new_special != item.data1[4]) {
if (this->item_parameter_table->get_special(item.data1[4]).type ==
this->item_parameter_table->get_special(new_special).type) {
item.data1[4] = new_special;
} else {
this->log.info("(Special) Delta canceled because it would change special category");
}
}
} catch (const runtime_error&) {
} catch (const out_of_range&) {
// Invalid special number passed to get_special; just ignore it
}
luck += this->tekker_adjustment_set->get_luck_for_special_upgrade(delta_index);