diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-06-01 23:31:07 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-06-01 23:31:07 -0500 |
commit | f4085a9faff3ab82600e306f587b2d84e0104108 (patch) | |
tree | cfc1b4464648a6b5da25e5c0f6c8bddcc0ad053d | |
parent | a665c0142e597373997a25e3c673fba2b9f24b56 (diff) | |
download | bot-games-f4085a9faff3ab82600e306f587b2d84e0104108.tar.gz bot-games-f4085a9faff3ab82600e306f587b2d84e0104108.zip |
return an error message if someone triest to join late
-rw-r--r-- | lib/Bot/Games/Game/Chess.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Bot/Games/Game/Chess.pm b/lib/Bot/Games/Game/Chess.pm index 752b381..473fe21 100644 --- a/lib/Bot/Games/Game/Chess.pm +++ b/lib/Bot/Games/Game/Chess.pm @@ -29,7 +29,8 @@ augment turn => sub { my $self = shift; my ($player, $move) = @_; $self->add_player($player) unless $self->has_player($player); - return unless $self->has_player($player); + return "The game has already begun between " . join ' and ', $self->players + unless $self->has_player($player); my $status = eval { $self->game->go_move($move) }; return $@ if $@; |