summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2015-01-01 16:42:50 +0100
committerJulien Dessaux2015-01-01 17:46:39 +0100
commitd9b7b0de319a063064caac315ae163574160c0fd (patch)
tree92339123269441bfdd9a47077b71845271b50f99
parentOnly kick registered nicks, and only reset the game if the kicked nick is a p... (diff)
downloadavalon-arthur-d9b7b0de319a063064caac315ae163574160c0fd.tar.gz
avalon-arthur-d9b7b0de319a063064caac315ae163574160c0fd.tar.bz2
avalon-arthur-d9b7b0de319a063064caac315ae163574160c0fd.zip
Do not start a game with more than the maximum number of players
-rw-r--r--Avalon.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/Avalon.pm b/Avalon.pm
index 0d60734..a0c92d0 100644
--- a/Avalon.pm
+++ b/Avalon.pm
@@ -90,6 +90,7 @@ sub start_game {
my $self = shift;
my $av = $self->{avalon};
my @players = shuffle keys $av->{registered};
+ @players = @players[0..9] if scalar @players > 10;
$av->{players} = \@players;
$self->say( channel => $av->{config}->{'game.channel'}, body => "GAMESTART " . join(' ', @players) );
$self->set_timeout(10);