Commit 164931b7 authored by 18손재민's avatar 18손재민 Committed by 18신대성

이제 게임오버된 사람의 호패가 나오지 않음

parent 645b87c2
......@@ -77,7 +77,7 @@ class GameRoom
{
this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1;
this.startCount = 2;
this.startCount = 3;
this.maxPlayer = 100;
this.nextRank = 100;
......
......@@ -471,8 +471,10 @@ WordSpace.nameQueue =
queue: [],
shuffle: function()
{
let tempIdx, tempElement, tempLength;
let tempQueue = RoomData.players;
let tempIdx, tempElement, tempLength, tempQueue = [];
RoomData.players.forEach(function(element){
tempQueue.push(element.index)
})
for(tempLength = tempQueue.length; tempLength; tempLength -= 1)
{
tempIdx = Math.floor(Math.random() * tempLength);
......@@ -482,7 +484,7 @@ WordSpace.nameQueue =
}
tempQueue.forEach(function(element)
{
if(element.id != PlayerData.id && element.isAlive)
if(RoomData.players[element].id != PlayerData.id && RoomData.players[element].isAlive)
WordSpace.nameQueue.queue.push(element);
});
},
......@@ -490,7 +492,8 @@ WordSpace.nameQueue =
{
let tempElement = WordSpace.nameQueue.queue.shift();
if(WordSpace.nameQueue.queue.length <= RoomData.aliveCount) this.shuffle();
return tempElement;
if(!RoomData.players[tempElement].isAlive) return WordSpace.nameQueue.pop();
else return RoomData.players[tempElement];
},
initiate: function()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment