From b9ac40d3d9700a14db1db5ee589af1788cb477bb Mon Sep 17 00:00:00 2001 From: Rampoina Date: Wed, 10 Aug 2022 02:22:42 +0200 Subject: [PATCH] Fix unit/building progress not getting restored when loading a game --- source/glest_game/type_instances/unit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index d13d897e..dc81399c 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -5342,7 +5342,9 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction * string skillTypeName = unitNode->getAttribute("currSkillName")->getValue(); SkillClass skillClass = static_cast(unitNode->getAttribute("currSkillClass")->getIntValue()); result->currSkill = ut->getSkillType(skillTypeName,skillClass); + int tempProgress2 = result->progress2; // setCurrSkill overwrites progress2 result->setCurrSkill(result->currSkill); + result->progress2 = tempProgress2; // restore it } // int lastModelIndexForCurrSkillType;