X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ultimate.js;h=358f2fb6634e4383d9222d6de4bb154939fa503a;hb=bfeb7552a144d5a1048ad20d3246f7c7dce4b05c;hp=57155dbb0c707256448c31b84da75709661ae458;hpb=5cbfa6034ad0dea57830bc74aeba1d84cf90bad9;p=pkanalytics diff --git a/ultimate.js b/ultimate.js index 57155db..358f2fb 100644 --- a/ultimate.js +++ b/ultimate.js @@ -482,6 +482,16 @@ function process_matches(json, filters) { } } + if (type !== 'out' && type !== 'in' && p !== undefined && p.on_field_since === null) { + console.log('Event “' + type + '” on subbed-out player ' + p.name + ' in ' + our_score + '\u2013' + their_score + ' in ' + match['description']); + } + if (type === 'catch' && handler !== null && players[handler].on_field_since === null) { + // The handler subbed out and was replaced with another handler, + // so this wasn't a pass. + console.log('Pass from subbed-out player ' + players[handler].name + ' in ' + our_score + '\u2013' + their_score + ' in ' + match['description'] + '; ignoring.'); + handler = null; + } + // Event management if (type === 'catch' || type === 'goal') { if (handler !== null) {