preserve exp when resetting materials; fixes #579

This commit is contained in:
Martin Michelsen
2024-10-27 22:59:52 -07:00
parent 0c9d4bf338
commit 4e7d6800cd
+3
View File
@@ -1187,8 +1187,11 @@ void PSOBBCharacterFile::import_tethealla_material_usage(std::shared_ptr<const L
void PSOBBCharacterFile::recompute_stats(std::shared_ptr<const LevelTable> level_table) {
uint32_t level = this->disp.stats.level;
uint32_t exp = this->disp.stats.experience;
level_table->reset_to_base(this->disp.stats, this->disp.visual.char_class);
level_table->advance_to_level(this->disp.stats, level, this->disp.visual.char_class);
this->disp.stats.experience = exp;
this->disp.stats.char_stats.atp += (this->get_material_usage(MaterialType::POWER) * 2);
this->disp.stats.char_stats.mst += (this->get_material_usage(MaterialType::MIND) * 2);
this->disp.stats.char_stats.evp += (this->get_material_usage(MaterialType::EVADE) * 2);