Do not prevent checks if captcha has been filled.

This commit is contained in:
asofold 2012-08-13 03:57:10 +02:00
parent bac6ce8501
commit 7222dee529

View File

@ -167,7 +167,7 @@ public class NoPwnage extends Check {
boolean cancel = false; boolean cancel = false;
if (!data.noPwnageHasFilledCaptcha) {
String message = ""; String message = "";
if (event instanceof AsyncPlayerChatEvent) if (event instanceof AsyncPlayerChatEvent)
message = ((AsyncPlayerChatEvent) event).getMessage(); message = ((AsyncPlayerChatEvent) event).getMessage();
@ -176,6 +176,7 @@ public class NoPwnage extends Check {
final boolean isCommand = event instanceof PlayerCommandPreprocessEvent; final boolean isCommand = event instanceof PlayerCommandPreprocessEvent;
final long now = System.currentTimeMillis(); final long now = System.currentTimeMillis();
if (!data.noPwnageHasFilledCaptcha) {
if (cc.noPwnageCaptchaCheck && data.noPwnageHasStartedCaptcha) { if (cc.noPwnageCaptchaCheck && data.noPwnageHasStartedCaptcha) {
// Correct answer to the captcha? // Correct answer to the captcha?
if (message.equals(data.noPwnageGeneratedCaptcha)) { if (message.equals(data.noPwnageGeneratedCaptcha)) {
@ -205,6 +206,7 @@ public class NoPwnage extends Check {
((PlayerCommandPreprocessEvent) event).setCancelled(true); ((PlayerCommandPreprocessEvent) event).setCancelled(true);
return cancel; return cancel;
} }
}
if (data.noPwnageLastLocation == null) if (data.noPwnageLastLocation == null)
data.noPwnageLastLocation = player.getLocation(); data.noPwnageLastLocation = player.getLocation();
@ -293,7 +295,7 @@ public class NoPwnage extends Check {
data.noPwnageLastMessageTime = now; data.noPwnageLastMessageTime = now;
lastGlobalMessage = message; lastGlobalMessage = message;
lastGlobalMessageTime = now; lastGlobalMessageTime = now;
}
return cancel; return cancel;
} }