diff options
-rw-r--r-- | lib/Bot/Games/Game/Chess.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Bot/Games/Game/Chess.pm b/lib/Bot/Games/Game/Chess.pm index 1739b9d..554fe9e 100644 --- a/lib/Bot/Games/Game/Chess.pm +++ b/lib/Bot/Games/Game/Chess.pm @@ -68,9 +68,15 @@ command resign => sub { command state => sub { my $self = shift; my ($dummy, $args) = @_; - return $self->current_player - . ($self->game->to_move ? ' (white)' : ' (black)') - . ' to play: ' + my $player; + if ($self->num_players == 2) { + $player = $self->current_player; + $player .= $self->game->to_move ? ' (white)' : ' (black)'; + } + else { + $player = $self->game->to_move ? 'White' : 'Black'; + } + return "$player to play: " . App::Nopaste::nopaste(text => $self->game->dump_pos, nick => $args->{player}); }; |