mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
fix: edge case; new tanks don't have averages
This commit is contained in:
1 parent
132817dbe0
commit
bf9f3ce20e
1 file changed
+5
-2
@@ -88,9 +88,12 @@ export default {
|
||||
WN8:
|
||||
entries.reduce((accumulator, [tankIdString, stats]) => {
|
||||
const tankId = Number(tankIdString);
|
||||
const tankWN8 = getWN8(tankAverages[tankId].all, stats);
|
||||
|
||||
return accumulator + tankWN8 * stats.battles;
|
||||
// edge case where new tanks don't have averages
|
||||
if (tankAverages[tankId]) {
|
||||
const tankWN8 = getWN8(tankAverages[tankId].all, stats);
|
||||
return accumulator + tankWN8 * stats.battles;
|
||||
} else return accumulator;
|
||||
}, 0) / totalBattles,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user