Fixed sorting when PP = Infinity

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

No files matched your search

+2 -1
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);