修复联机创建房间不考虑动态人数问题

This commit is contained in:
Spmario233 2023-10-31 17:37:49 +08:00
parent 8204a42dc8
commit abaebb2793
1 changed files with 7 additions and 2 deletions

View File

@ -53357,14 +53357,19 @@
}, },
player:(position,noclick)=>new lib.element.Player(position,noclick), player:(position,noclick)=>new lib.element.Player(position,noclick),
connectPlayers:ip=>{ connectPlayers:ip=>{
ui.updateConnectPlayerPositions();
game.connectPlayers=[]; game.connectPlayers=[];
const numberOfPlayers=lib.configOL.number; let numberOfPlayers=lib.configOL.number;
const gameMode=lib.configOL.mode;
if(gameMode=='guozhan'||(gameMode=='identity'&&(lib.configOL.identity_mode!='zhong'&&lib.configOL.identity_mode!='purple'))){
numberOfPlayers=10;
}
ui.updateConnectPlayerPositions(numberOfPlayers);
for(let position=0;position<numberOfPlayers;position++){ for(let position=0;position<numberOfPlayers;position++){
const player=ui.create.player(ui.window); const player=ui.create.player(ui.window);
player.dataset.position=position; player.dataset.position=position;
player.classList.add('connect'); player.classList.add('connect');
game.connectPlayers.push(player); game.connectPlayers.push(player);
if(position>=lib.configOL.number) player.classList.add('unselectable2');
} }
var bar=ui.create.div(ui.window); var bar=ui.create.div(ui.window);