summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-22 15:13:16 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-22 15:13:16 -0400
commitc2885aa2f66508a5f6257040d1ab6f302e42f37f (patch)
treeddba6448494b6833079edff196ca505ba5301205
parentdac3ce1c1d581883db00d9779f413e989c1f5049 (diff)
downloadBot-Zulip-Chess-c2885aa2f66508a5f6257040d1ab6f302e42f37f.tar.gz
Bot-Zulip-Chess-c2885aa2f66508a5f6257040d1ab6f302e42f37f.zip
fix players being unable to move
-rw-r--r--lib/Bot/Zulip/Chess.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Bot/Zulip/Chess.pm b/lib/Bot/Zulip/Chess.pm
index 7b9bf06..889fd28 100644
--- a/lib/Bot/Zulip/Chess.pm
+++ b/lib/Bot/Zulip/Chess.pm
@@ -174,9 +174,7 @@ sub draw_state ($self) {
sub players_turn ($self, $player) {
my $method = $self->_chessboard->to_move ? 'white_player' : 'black_player';
my $expected_player = $self->$method;
- return if grep { $_ eq $player } grep { defined } (
- $self->white_player, $self->black_player
- );
+ return if !$self->has_black_player && $self->white_player eq $player;
return 1 if !defined($expected_player);
return 1 if $expected_player eq $player;
return;