diff --git a/CHANGELOG.md b/CHANGELOG.md index 95f4609..8a840d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,8 @@ see next point) and `tshock` (which is `terraria`). #### Games * Removed the players::setNum method, the library will no longer add empty players as -a placeholder in the `players` fields. +placeholders in the `players` fields. +* Valve: dont skip players with no name and keep state.raw.players. * Stabilized field `numplayers`. * BeamMP (2021) - Added support. diff --git a/protocols/valve.js b/protocols/valve.js index acb6d2a..6866c25 100644 --- a/protocols/valve.js +++ b/protocols/valve.js @@ -188,9 +188,6 @@ export default class valve extends Core { this.logger.debug('Found player: ' + name + ' ' + score + ' ' + time) - // connecting players don't count as players. - if (!name) continue - // CSGO sometimes adds a bot named 'Max Players' if host_players_show is not 2 if (state.raw.appId === AppId.CSGO && name === 'Max Players') continue @@ -274,7 +271,7 @@ export default class valve extends Core { const sortedPlayers = state.raw.players.sort((a, b) => { return botProbability(a) - botProbability(b) }) - delete state.raw.players + const numBots = state.raw.numbots || 0 while (state.bots.length < numBots && sortedPlayers.length) {