mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 21:07:27 +00:00
fix: set champion playrate to 0 if not present in the json data
This commit is contained in:
parent
35b978cd68
commit
16a8f2503a
1 changed files with 15 additions and 0 deletions
|
|
@ -146,6 +146,21 @@ class RoleIdentificationService {
|
|||
* @param support
|
||||
*/
|
||||
getRoles(championPositions, composition, jungle = null, support = null) {
|
||||
// Set composition champion playrate to 0% if not present in the json data
|
||||
for (const compChamp of composition) {
|
||||
if (championPositions[compChamp]) {
|
||||
continue
|
||||
}
|
||||
|
||||
championPositions[compChamp] = {
|
||||
MIDDLE: 0,
|
||||
UTILITY: 0,
|
||||
TOP: 0,
|
||||
JUNGLE: 0,
|
||||
BOTTOM: 0
|
||||
}
|
||||
}
|
||||
|
||||
const identified = {}
|
||||
let positions = {}
|
||||
let secondaryPositions = null
|
||||
|
|
|
|||
Loading…
Reference in a new issue