Fixed sorting when PP = Infinity

This commit is contained in:
Daniel van Noord
2020-12-01 12:44:13 +01:00
parent 26549a148a
commit 810c5adfba
2 changed files with 4 additions and 2 deletions

View File

@@ -700,7 +700,8 @@ CM.Disp.UpdateBuildings = function() {
o.id = Game.Objects[k].id;
return o;
});
arr.sort((a, b) => a.pp - b.pp);
arr.sort(function(a, b){ return (a.pp > b.pp ? 1 : (a.pp < b.pp ? -1 : 0)) });
for (var x = 0; x < arr.length; x++) {
Game.Objects[arr[x].name].l.style.gridRow = (x + 2) + "/" + (x + 2);