summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Avalon.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/Avalon.pm b/Avalon.pm
index 965d554..cb87adc 100644
--- a/Avalon.pm
+++ b/Avalon.pm
@@ -186,7 +186,14 @@ sub told {
$self->start_game if $self->game_ready;
}
when ("REGISTERED") {}
- when ("UNREGISTER") {}
+ when ("UNREGISTER") {
+ return unless $av->{registered}->{$who} or $who ~~ $av->{players};
+ delete $av->{registered}->{$who};
+ $self->say( channel => $av->{config}->{'game.channel'}, body => "UNREGISTERED $who" );
+ if ($av->{gamephase} == GAMESTART or (scalar @args > 0 and $args[0] eq "now" and $who ~~ $av->{players})) {
+ $self->reset_game;
+ }
+ }
when ("UNREGISTERED") {}
when ("GAMESTART") {}
when ("ROLE") {}