Skip to content

Commit

Permalink
Fix Elite Soldiers stat display bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sho-87 committed Apr 13, 2020
1 parent 10af614 commit 6a777ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rok-talents",
"title": "RoK Talents",
"version": "1.4.2",
"version": "1.4.3",
"dataVersion": 1,
"description": "Rise of Kingdoms talent builder",
"homepage": "https://roktalents.com",
Expand Down
18 changes: 13 additions & 5 deletions src/InfoPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ class InfoPanel extends Component {

if (pointsAssigned !== 0) {
const talent = talentData[i];
const statName = talent.stats;

let statName;
if (talent.stats instanceof Array) {
statName = talent.stats;
} else if (talent.stats !== '') {
statName = [talent.stats];
}

if (statName) {
if (!(statName in stats)) {
stats[statName] = 0;
for (let stat of statName) {
if (!(stat in stats)) {
stats[stat] = 0;
}
stats[stat] += talent.values[pointsAssigned - 1];
}
stats[statName] += talent.values[pointsAssigned - 1];
}

if (talent.type === 'node-large') {
Expand All @@ -57,7 +65,7 @@ class InfoPanel extends Component {
talent.text,
talent.values,
pointsAssigned - 1
)
),
});
}
}
Expand Down

0 comments on commit 6a777ae

Please sign in to comment.