diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-10-22 16:26:15 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-10-22 16:26:15 -0400 |
commit | aedb81510d05b9639cbb2d0035607c48e3196366 (patch) | |
tree | 2297e942f505b31070e4b05bf30913044a719325 | |
parent | 4753e4767eab175ec6e3e712dfbec59c3c13e1e2 (diff) | |
download | Bot-Zulip-Chess-aedb81510d05b9639cbb2d0035607c48e3196366.tar.gz Bot-Zulip-Chess-aedb81510d05b9639cbb2d0035607c48e3196366.zip |
state should be able to be used by anyone
-rw-r--r-- | lib/Bot/Zulip/Chess.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Bot/Zulip/Chess.pm b/lib/Bot/Zulip/Chess.pm index 93cc5ba..ef42640 100644 --- a/lib/Bot/Zulip/Chess.pm +++ b/lib/Bot/Zulip/Chess.pm @@ -156,6 +156,10 @@ sub step ($self) { } sub handle_move ($self, $player, $move) { + if ($move eq 'state') { + return $self->draw_state; + } + if (!$self->players_turn($player)) { return "It's not your turn!"; } @@ -165,10 +169,7 @@ sub handle_move ($self, $player, $move) { } return try { - if ($move eq 'state') { - $self->draw_state; - } - elsif ($move eq 'resign') { + if ($move eq 'resign') { my $msg = '@**' . $self->current_player . "** resigned"; $self->reset_board; } |