From 2f92b84426c6c581837d4f4e061f53e44b0f3879 Mon Sep 17 00:00:00 2001 From: Valentin Kaelin Date: Sat, 8 May 2021 15:53:27 +0200 Subject: [PATCH] feat(live-tab): add roles in custom games too --- server/app/Transformers/LiveMatchTransformer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/app/Transformers/LiveMatchTransformer.ts b/server/app/Transformers/LiveMatchTransformer.ts index 74003a7..d4f32ef 100644 --- a/server/app/Transformers/LiveMatchTransformer.ts +++ b/server/app/Transformers/LiveMatchTransformer.ts @@ -38,7 +38,10 @@ class LiveMatchTransformer extends MatchTransformer { const redTeam: PlayerRole[] = [] // 200 let blueRoles: FinalRoleComposition = {} let redRoles: FinalRoleComposition = {} - const needsRole = this.championRoles && queuesWithRole.includes(liveMatch.gameQueueConfigId) + const needsRole = this.championRoles && + (queuesWithRole.includes(liveMatch.gameQueueConfigId) || + (liveMatch.gameType === 'CUSTOM_GAME' && liveMatch.participants.length === 10)) + if (needsRole) { liveMatch.participants.map(p => { const playerRole = { champion: p.championId, jungle: p.spell1Id === 11 || p.spell2Id === 11 }