Skip to content

Commit

Permalink
fix undefined slot
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Feb 20, 2024
1 parent cf8994b commit 3db0f60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion processors/processTeamfights.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ function processTeamfights(entries, meta) {
// Using slot directly as index appears to be incorrect for these fields as of 2024 (see processExpand)
// So just compute an index based on player_slot
const computedSlot = e.player_slot % (128 - 5);
tf.players[computedSlot][e.type][e.key] = (tf.players[computedSlot][e.type][e.key] ?? 0) + 1;
if (tf.players[computedSlot]?.[e.type]) {
tf.players[computedSlot][e.type][e.key] = (tf.players[computedSlot][e.type][e.key] ?? 0) + 1;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#curl localhost:5600 --data-binary "@/datadrive/odota-parser/7355186741_1742953546.dem"
#curl localhost:5600 --data-binary "@/datadrive/odota-parser/7437280975_580771917.dem"

curl localhost:5600/blob?replay_url=http://replay153.valve.net/570/7580803996_2070517572.dem.bz2
curl localhost:5600/blob?replay_url=http://replay273.valve.net/570/7598355161_711705904.dem.bz2

0 comments on commit 3db0f60

Please sign in to comment.