Skip to content

Commit

Permalink
Fix issue when IslandTypeChallenges required blocks were cleared if c…
Browse files Browse the repository at this point in the history
…ompletion was uncessesfull.

The issue was that it cleared wrong map. It must clear priority queue, but cleared required elements.
  • Loading branch information
BONNe committed May 16, 2019
1 parent 34ed09e commit 9704ed3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ public TryToComplete(ChallengesAddon addon,
this.permissionPrefix = permissionPrefix;
this.user = user;
this.manager = addon.getChallengesManager();
this.challenge = challenge;
// To avoid any modifications that may accure to challenges in current completion
// just clone it.
this.challenge = challenge.clone();
this.topLabel = topLabel;
}

Expand Down Expand Up @@ -1021,7 +1023,7 @@ private ChallengeResult searchForBlocks(Map<Material, Integer> requiredMap, int
// kick garbage collector
blocks.clear();
blocksFound.clear();
requiredMap.clear();
blockFromWorld.clear();

return EMPTY_RESULT;
}
Expand Down

0 comments on commit 9704ed3

Please sign in to comment.