properly filter when setting gems

develop
Myk Taylor 2023-03-20 15:41:34 -07:00
parent a545bc8120
commit f13df882b6
No known key found for this signature in database
1 changed files with 7 additions and 3 deletions

@ -1866,9 +1866,13 @@ void StockpileSerializer::read_gems(DeserializeMode mode, const std::string& fil
if (all) { if (all) {
for (size_t idx = 0; idx < builtin_size; ++idx) { for (size_t idx = 0; idx < builtin_size; ++idx) {
MaterialInfo mi; MaterialInfo mi;
mi.decode(idx, -1);
if (gem_other_mat_is_allowed(mi))
set_filter_elem(filter, val, mi.getToken(), idx, pgems.rough_other_mats.at(idx));
if (!mi.isValid())
mi.decode(0, idx); mi.decode(0, idx);
set_filter_elem(filter, val, mi.toString(), idx, pgems.rough_other_mats.at(idx)); if (gem_other_mat_is_allowed(mi))
set_filter_elem(filter, val, mi.toString(), idx, pgems.cut_other_mats.at(idx)); set_filter_elem(filter, val, mi.getToken(), idx, pgems.cut_other_mats.at(idx));
} }
return; return;
} else { } else {