fix(role-identification): better fix to remove duplicate

This commit is contained in:
Valentin Kaelin 2020-09-29 18:02:44 +02:00
parent dc6b7617d3
commit e73b231db2
2 changed files with 2 additions and 2 deletions

View file

@ -197,7 +197,7 @@ class RoleIdentificationService {
// Done! Grab the results. // Done! Grab the results.
const positionsWithMetric = {} const positionsWithMetric = {}
for (const [position, champion] of Object.entries(positions)) { for (const [position, champion] of Object.entries(positions)) {
if (Object.keys(identified).includes(position)) { if (Object.keys(identified).includes(position) || champion === jungle || champion === support) {
continue continue
} }
positionsWithMetric[position] = { positionsWithMetric[position] = {

View file

@ -212,7 +212,7 @@ class MatchTransformer {
const teamSupports = team.filter(p => p.support && !p.jungle) const teamSupports = team.filter(p => p.support && !p.jungle)
const support = teamSupports.length === 1 ? teamSupports[0].champion : null const support = teamSupports.length === 1 ? teamSupports[0].champion : null
return RoleIdentificationService.getRoles(this.championRoles, team.map(p => p.champion), null, support) return RoleIdentificationService.getRoles(this.championRoles, team.map(p => p.champion), jungle, support)
} }
/** /**