Fix unit/building progress not getting restored when loading a game

This commit is contained in:
Rampoina 2022-08-10 02:22:42 +02:00
parent c4c426ed74
commit b9ac40d3d9
1 changed files with 2 additions and 0 deletions

View File

@ -5342,7 +5342,9 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction *
string skillTypeName = unitNode->getAttribute("currSkillName")->getValue();
SkillClass skillClass = static_cast<SkillClass>(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;