Fixed bug where it was impossible to get max level of enchants from

fishing.
This commit is contained in:
gmcferrin 2012-02-02 11:18:26 -05:00
parent 123e96e39d
commit 81ab8692ad

View File

@ -1077,12 +1077,10 @@ public class Fishing {
if(Math.random() * 15 < Fishing.getFishingLootTier(PP)) if(Math.random() * 15 < Fishing.getFishingLootTier(PP))
{ {
enchanted = true; enchanted = true;
int randomEnchantLevel = (int)(Math.random() * x.getMaxLevel()); int randomEnchantLevel = (int)(Math.random() * x.getMaxLevel()) + 1;
if(randomEnchantLevel == 0) if(randomEnchantLevel == 0)
randomEnchantLevel = 1; randomEnchantLevel = 1;
if(randomEnchantLevel > x.getMaxLevel())
randomEnchantLevel = x.getMaxLevel();
fishingResults.addEnchantment(x, randomEnchantLevel); fishingResults.addEnchantment(x, randomEnchantLevel);
} }