Skip to content

Commit e70782a

Browse files
committed
🐛 Fix honor when best value is 0
1 parent 13075c5 commit e70782a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "exile-x",
33
"private": true,
4-
"version": "0.3.0",
4+
"version": "0.3.1",
55
"description": "A League Client Companion with automatisations",
66
"main": "dist-electron/main.js",
77
"author": "Gredon",

plugins/Honor.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,20 @@ class Honor {
119119
for (const stat in stats) {
120120
let actualStat = player.stats[stat];
121121
const { type, value: bestValue, weigth } = stats[stat];
122-
console.log(`- ${stat} : ${bestValue}`);
122+
console.log(`- ${stat} : ${actualStat}`);
123123

124124
if (type === 'lower') {
125125
score += actualStat ? (bestValue / actualStat) * weigth : weigth / 5 + weigth;
126126
continue;
127127
}
128128

129+
if (!bestValue) {
130+
console.log(`Best Value for ${stat} is ${bestValue} so ignore it.`);
131+
continue
132+
};
133+
129134
score += (actualStat / bestValue) * weigth;
135+
130136
}
131137

132138
console.log(`- Score : ${score} \n`);
@@ -171,6 +177,7 @@ class Honor {
171177
}
172178
}
173179

180+
console.log('Best Stats', bestStats);
174181
return bestStats;
175182
}
176183

0 commit comments

Comments
 (0)