Skip to content

Commit

Permalink
Make sure specialPrice is not refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
Reldeam committed Feb 3, 2022
1 parent a20bd68 commit 2906354
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public CustomTrade(

recipe.addIngredient(firstIngredient);
if(secondIngredient != null) recipe.addIngredient(secondIngredient);

recipe.setPriceMultiplier(priceMultiplier.floatValue());

recipe.setExperienceReward(giveExperienceToPlayer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ public void refreshTrades(Merchant merchant) {

MerchantRecipe oldRecipe = oldRecipes.get(index);
MerchantRecipe newRecipe = customTrade.getRecipe();
// set the uses of the previous recipe so that players
// cant continually refresh uses by closing and opening
// the trade window
// set the uses and special price of the previous recipe so
// that players cant continually refresh uses and price by
// closing and opening the trade window
newRecipe.setUses(oldRecipe.getUses());
newRecipe.setSpecialPrice(oldRecipe.getSpecialPrice());

// add updated recipe
newRecipes.add(newRecipe);
Expand Down

0 comments on commit 2906354

Please sign in to comment.