Skip to content

Commit 3db0f60

Browse files
committed
fix undefined slot
1 parent cf8994b commit 3db0f60

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

processors/processTeamfights.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ function processTeamfights(entries, meta) {
131131
// Using slot directly as index appears to be incorrect for these fields as of 2024 (see processExpand)
132132
// So just compute an index based on player_slot
133133
const computedSlot = e.player_slot % (128 - 5);
134-
tf.players[computedSlot][e.type][e.key] = (tf.players[computedSlot][e.type][e.key] ?? 0) + 1;
134+
if (tf.players[computedSlot]?.[e.type]) {
135+
tf.players[computedSlot][e.type][e.key] = (tf.players[computedSlot][e.type][e.key] ?? 0) + 1;
136+
}
135137
}
136138
}
137139
}

scripts/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
#curl localhost:5600 --data-binary "@/datadrive/odota-parser/7355186741_1742953546.dem"
44
#curl localhost:5600 --data-binary "@/datadrive/odota-parser/7437280975_580771917.dem"
55

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

0 commit comments

Comments
 (0)