Skip to content

Commit

Permalink
Fixed bug yannprada#12
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoretsu committed Feb 14, 2021
1 parent 869d685 commit bf92ec5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cookie-garden-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class Garden {
if (plant.weed && config.autoHarvestWeeds) {
this.harvest(x, y);
}
let [seedId] = config.savedPlot[y][x];
let [seedId] = config.savedPlot.length > 0 ? config.savedPlot[y][x] : [0, 0];
seedId -= 1;
if (
config.autoHarvestCleanGarden &&
Expand Down
2 changes: 1 addition & 1 deletion src/Garden.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Garden {
if (plant.weed && config.autoHarvestWeeds) {
this.harvest(x, y);
}
let seedId = config.savedPlot[y][x][0];
let seedId = config.savedPlot.length > 0 ? config.savedPlot[y][x][0] : [0, 0];
seedId -= 1;
if (
config.autoHarvestCleanGarden &&
Expand Down

0 comments on commit bf92ec5

Please sign in to comment.