From 78666ade2b26d4d4003dfa7640d88001ef2ac9be Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 20 Dec 2012 20:11:45 +0000 Subject: Fix max tempban length option. --- Essentials/src/com/earth2me/essentials/commands/Commandtempban.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index 4ac2db89c..97aa2ea3b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -46,8 +46,8 @@ public class Commandtempban extends EssentialsCommand final String time = getFinalArg(args, 1); final long banTimestamp = Util.parseDateDiff(time, true); - final long max = ess.getSettings().getMaxTempban(); - if(max != 0 && banTimestamp - GregorianCalendar.getInstance().getTimeInMillis() > max * 1000 && ess.getUser(sender).isAuthorized("essentials.tempban.unlimited")) + final long maxBanLength = ess.getSettings().getMaxTempban() * 1000; + if(maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && ess.getUser(sender).isAuthorized("essentials.tempban.unlimited")) { sender.sendMessage(_("oversizedTempban")); throw new NoChargeException(); -- cgit v1.2.3