mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
fix: remove another instance of adding empty player objects valve
Related: #389
This commit is contained in:
parent
dcc69a36b2
commit
90e26bb442
1 changed files with 5 additions and 6 deletions
|
|
@ -427,13 +427,12 @@ export default class valve extends Core {
|
||||||
})
|
})
|
||||||
delete state.raw.players
|
delete state.raw.players
|
||||||
const numBots = state.raw.numbots || 0
|
const numBots = state.raw.numbots || 0
|
||||||
while (state.bots.length < numBots) {
|
|
||||||
if (sortedPlayers.length) state.bots.push(sortedPlayers.pop())
|
while (state.bots.length < numBots && sortedPlayers.length) {
|
||||||
else state.bots.push({})
|
state.bots.push(sortedPlayers.pop())
|
||||||
}
|
}
|
||||||
while (state.players.length < state.numplayers - numBots || sortedPlayers.length) {
|
while ((state.players.length < state.numplayers - numBots || sortedPlayers.length) && sortedPlayers.length) {
|
||||||
if (sortedPlayers.length) state.players.push(sortedPlayers.pop())
|
state.players.push(sortedPlayers.pop())
|
||||||
else state.players.push({})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue