diff --git a/CookieMonster.js b/CookieMonster.js index 9282fff..8068ff5 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1496,7 +1496,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); diff --git a/src/Disp.js b/src/Disp.js index 84b37d9..d06238a 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -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);