From 4e7d6800cd1a5779c3a43a66092f589b683513a5 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sun, 27 Oct 2024 22:59:52 -0700 Subject: [PATCH] preserve exp when resetting materials; fixes #579 --- src/SaveFileFormats.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SaveFileFormats.cc b/src/SaveFileFormats.cc index 9b8837d7..4e052966 100644 --- a/src/SaveFileFormats.cc +++ b/src/SaveFileFormats.cc @@ -1187,8 +1187,11 @@ void PSOBBCharacterFile::import_tethealla_material_usage(std::shared_ptr 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);