Skip to content

Commit

Permalink
Battlefield: Set numplayers from info, not players
Browse files Browse the repository at this point in the history
  • Loading branch information
CosminPerRam committed Oct 27, 2023
1 parent b8fc9a4 commit d5f191d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions protocols/battlefield.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class battlefield extends Core {
{
const data = await this.query(socket, ['serverInfo'])
state.name = data.shift()
state.raw.numplayers = parseInt(data.shift())
state.numplayers = parseInt(data.shift())
state.maxplayers = parseInt(data.shift())
state.raw.gametype = data.shift()
state.map = data.shift()
Expand Down Expand Up @@ -76,8 +76,8 @@ export default class battlefield extends Core {
for (let i = 0; i < fieldCount; i++) {
fields.push(data.shift())
}
state.numplayers = data.shift()
for (let i = 0; i < state.numplayers; i++) {
const numplayers = data.shift()
for (let i = 0; i < numplayers; i++) {
const player = {}
for (let key of fields) {
let value = data.shift()
Expand Down

0 comments on commit d5f191d

Please sign in to comment.