Skip to content

Commit

Permalink
Fixed RecursionLimit Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Adr-hyng authored Aug 7, 2022
1 parent 9bba010 commit 04f505c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions scripts/AxeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export const axeConfig = {

/**
* Total blocks this lumber axe can auto chop.
* ! Warning:
* ! - Performance of game drops, when this limit is exceeds to 300
* ! or recursionLimit > 300. You are warned.
*/
recursionLimit: 300
};
Expand Down
6 changes: 4 additions & 2 deletions scripts/Lumberjack System/lumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class LumberJack {
}
});

this.recursiveLimit = recursionLimit; // Limit of Blocks
this.totalBlocksDestroyed = this.getTotalBlocks();
this.itemDamage = axeDamage;

Expand All @@ -77,7 +78,7 @@ class LumberJack {
return;
}

this.recursiveLimit = recursionLimit; // Limit of Blocks

}

/**
Expand Down Expand Up @@ -364,13 +365,14 @@ class LumberCount {
}
});

this.recursiveLimit = recursionLimit;
this.totalBlocksDestroyed = 0;
this.itemDamage = axeDamage;

this.enchantmentEffect();
this.durabilityChecker();

this.recursiveLimit = recursionLimit;

}

isVisited(blockLoc, visited){
Expand Down

0 comments on commit 04f505c

Please sign in to comment.