Don't run these calculations twice. Also, pretty sure one of these was

bugged.
This commit is contained in:
GJ
2013-05-21 11:41:39 -04:00
parent 4f8b66f94d
commit 0b6372a6ea
6 changed files with 82 additions and 63 deletions

View File

@ -287,9 +287,10 @@ public class MiningManager extends SkillManager {
long oldTime = profile.getSkillDATS(AbilityType.BLAST_MINING) * Misc.TIME_CONVERSION_FACTOR;
int cooldown = AbilityType.BLAST_MINING.getCooldown();
int timeRemaining = SkillUtils.calculateTimeLeft(oldTime, cooldown, player);
if (!SkillUtils.cooldownOver(oldTime, cooldown, player)) {
player.sendMessage(LocaleLoader.getString("Skills.TooTired", SkillUtils.calculateTimeLeft(oldTime, cooldown, player)));
if (timeRemaining > 0) {
player.sendMessage(LocaleLoader.getString("Skills.TooTired", timeRemaining));
return false;
}