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