Fix T6 telemetry to read stock match counters

This commit is contained in:
2026-10-09 09:54:11 -04:00
parent 58399d2191
commit b172086301
3 changed files with 7 additions and 9 deletions
+4 -7
View File
@@ -165,17 +165,14 @@ telemetry_nonnegative_int(value)
return int(value);
}
// T6 stock does not expose per-match kill/headshot/down/revive counters as a
// plain player.stats[] dictionary the way T5 does; _zm_stats writes through
// increment_client_stat / increment_player_stat into persistent stat storage.
// Read player.stats[name] when present so any mod that mirrors T5 into it
// still populates the report; otherwise emit 0 to preserve payload shape.
// T6 stock initializes and updates match counters in player.pers[] through
// _globallogic_score::initpersstat / incpersstat; getpersstat reads this array.
telemetry_stat(player, name)
{
if (!isDefined(player.stats) || !isDefined(player.stats[name]))
if (!isDefined(player.pers) || !isDefined(player.pers[name]))
return 0;
return telemetry_nonnegative_int(player.stats[name]);
return telemetry_nonnegative_int(player.pers[name]);
}
telemetry_players_json(include_stats)