primeSortPlayers should not return a playerID twice, refs 59ce8b3081
.
The other maps had never read this playerID, so it wasn't noticed until Jebel Barkal read it. Paste: https://code.wildfiregames.com/P115 Reviewed By: temple This was SVN commit r21568.
This commit is contained in:
parent
ded01c904d
commit
2d10c4374f
@ -516,16 +516,16 @@ function sortAllPlayers()
|
||||
*/
|
||||
function primeSortPlayers(playerIDs)
|
||||
{
|
||||
if (!playerIDs.length)
|
||||
return [];
|
||||
|
||||
let prime = [];
|
||||
for (let i = 0; i < Math.ceil(playerIDs.length / 2); ++i)
|
||||
for (let i = 0; i < Math.floor(playerIDs.length / 2); ++i)
|
||||
{
|
||||
prime.push(playerIDs[i]);
|
||||
prime.push(playerIDs[playerIDs.length - 1 - i]);
|
||||
}
|
||||
|
||||
if (playerIDs.length % 2)
|
||||
prime.push(playerIDs[Math.floor(playerIDs.length / 2)]);
|
||||
|
||||
return prime;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user