Supp items: fix #1
This commit is contained in:
@@ -78,7 +78,7 @@ function handleParticipantRunes(participant, runes: Array<Rune>) {
|
||||
if(addRunes) runes.push(gameRunes)
|
||||
}
|
||||
|
||||
function handleMatchItems(timeline, participantIndex : number, builds: Builds) {
|
||||
function handleMatchItems(timeline, participant: any, participantIndex : number, builds: Builds) {
|
||||
const items : Array<number> = []
|
||||
for(let frame of timeline.info.frames) {
|
||||
for(let event of frame.events) {
|
||||
@@ -89,9 +89,26 @@ function handleMatchItems(timeline, participantIndex : number, builds: Builds) {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if(event.type != "ITEM_PURCHASED") continue;
|
||||
|
||||
let itemInfo = itemDict.get(event.itemId)
|
||||
// Handle bounty of worlds destroy as upgrade
|
||||
if(event.type == "ITEM_DESTROYED") {
|
||||
if(event.itemId == 3867) {
|
||||
let suppItem : number = itemInfo.to.find((x:number) =>
|
||||
x == participant.item0
|
||||
|| x == participant.item1
|
||||
|| x == participant.item2
|
||||
|| x == participant.item3
|
||||
|| x == participant.item4
|
||||
|| x == participant.item5
|
||||
|| x == participant.item6 )
|
||||
if(suppItem != undefined)
|
||||
items.push(suppItem)
|
||||
}
|
||||
}
|
||||
if(event.type != "ITEM_PURCHASED") continue;
|
||||
|
||||
|
||||
|
||||
// Handle boots differently
|
||||
if(itemInfo.categories.includes("Boots")){
|
||||
@@ -183,7 +200,7 @@ async function championInfos(client, patch: number, champion: Champion) {
|
||||
handleParticipantRunes(participant, lane.runes)
|
||||
|
||||
// Items
|
||||
handleMatchItems(match.timeline, participantIndex, lane.builds)
|
||||
handleMatchItems(match.timeline, participant, participantIndex, lane.builds)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user