let type = e['type'];
let p = players[e['player']];
- // Point count management
- if (p !== undefined && type !== 'out' && p.last_point_seen !== point_num) {
- p.last_point_seen = point_num;
- ++p.points_played;
- }
- if (type === 'goal' || type === 'their_goal') {
- ++point_num;
- }
-
// Sub management
if (type === 'in' && p.on_field_since === null) {
p.on_field_since = t;
} else if (type === 'goal' || type === 'their_goal' || type === 'stoppage') {
for (const [q,p] of Object.entries(players)) {
if (p.on_field_since !== null) {
+ if (p.last_point_seen !== point_num) {
+ // In case the player did nothing this point,
+ // not even subbing in.
+ p.last_point_seen = point_num;
+ ++p.points_played;
+ }
attribute_player_time(p, t, live_since);
}
}
live_since = null;
}
+ // Point count management
+ if (p !== undefined && type !== 'out' && p.last_point_seen !== point_num) {
+ p.last_point_seen = point_num;
+ ++p.points_played;
+ }
+ if (type === 'goal' || type === 'their_goal') {
+ ++point_num;
+ }
+
// Pull management
if (type === 'pull') {
puller = e['player'];