Skip to content

Commit

Permalink
Sort Building list based on PP of selected buy mode (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord authored Nov 24, 2020
1 parent 8ea9400 commit d40f90d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CookieMonster.js
Original file line number Diff line number Diff line change
Expand Up @@ -1283,9 +1283,9 @@ CM.Disp.UpdateBuildings = function() {

// Build array of pointers, sort by pp, use array index (+2) as the grid row number
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
var arr = Object.keys(CM.Cache.Objects).map(k =>
var arr = Object.keys(CM.Cache[target]).map(k =>
{
var o = CM.Cache.Objects[k];
var o = CM.Cache[target][k];
o.name = k;
o.id = Game.Objects[k].id;
return o;
Expand Down
4 changes: 2 additions & 2 deletions src/Disp.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,9 @@ CM.Disp.UpdateBuildings = function() {

// Build array of pointers, sort by pp, use array index (+2) as the grid row number
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
var arr = Object.keys(CM.Cache.Objects).map(k =>
var arr = Object.keys(CM.Cache[target]).map(k =>
{
var o = CM.Cache.Objects[k];
var o = CM.Cache[target][k];
o.name = k;
o.id = Game.Objects[k].id;
return o;
Expand Down

0 comments on commit d40f90d

Please sign in to comment.