diff options
author | Marko Zajc <marko@zajc.eu.org> | 2023-07-30 04:04:33 +0200 |
---|---|---|
committer | Marko Zajc <marko@zajc.eu.org> | 2023-08-02 00:58:59 +0200 |
commit | 6ec1d834e295224e457abd1f9079f13fd6608ba5 (patch) | |
tree | 30d779979191a743ace9e91c15bbcc8bef205102 | |
parent | 85479e91c166a6fdc98175fecdbdda3f584a558a (diff) |
[module-games] Fix AkinatorCommand
-rw-r--r-- | module-games/src/main/java/libot/commands/AkinatorCommand.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/module-games/src/main/java/libot/commands/AkinatorCommand.java b/module-games/src/main/java/libot/commands/AkinatorCommand.java index cdd88b7..a2d9a47 100644 --- a/module-games/src/main/java/libot/commands/AkinatorCommand.java +++ b/module-games/src/main/java/libot/commands/AkinatorCommand.java | |||
@@ -79,17 +79,18 @@ public class AkinatorCommand extends Command { | |||
79 | 79 | ||
80 | try { | 80 | try { |
81 | for (var q = aw.getQuestion(); q != null; q = aw.getQuestion()) { | 81 | for (var q = aw.getQuestion(); q != null; q = aw.getQuestion()) { |
82 | if (checkGuess(c, aw, false)) | ||
83 | return; | ||
84 | |||
82 | askQuestion(c, aw, q, startTimestamp, lastTimestamp, oldProgress, progression); | 85 | askQuestion(c, aw, q, startTimestamp, lastTimestamp, oldProgress, progression); |
83 | oldProgress = progression; | 86 | oldProgress = progression; |
84 | progression = q.getProgression(); | 87 | progression = q.getProgression(); |
85 | 88 | ||
86 | if (checkGuess(c, aw, false)) | ||
87 | return; | ||
88 | |||
89 | lastTimestamp = currentTimeMillis(); | 89 | lastTimestamp = currentTimeMillis(); |
90 | } | 90 | } |
91 | 91 | ||
92 | checkGuess(c, aw, true); | 92 | if (!checkGuess(c, aw, true)) |
93 | finish(c, aw, null); | ||
93 | 94 | ||
94 | } catch (ServerStatusException e) { | 95 | } catch (ServerStatusException e) { |
95 | if (TIMEOUT_MESSAGE.equals(e.getStatus().getMessage())) | 96 | if (TIMEOUT_MESSAGE.equals(e.getStatus().getMessage())) |