summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bot/Games.pm')
-rw-r--r--lib/Bot/Games.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index 0479e8e..22bf855 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -62,7 +62,6 @@ sub said {
eval "require $game_package";
$game = $game_package->new;
$self->active_games->{$game_name} = $game;
- $self->done_init->{$game_name} = 0;
}
if (!$self->done_init->{$game_name}
&& (!defined($action) || $action !~ /^-/)) {
@@ -97,7 +96,10 @@ sub said {
$self->$say($turn) if $turn;
}
- delete $self->active_games->{$game_name} if ($game->is_over);
+ if ($game->is_over) {
+ delete $self->active_games->{$game_name};
+ delete $self->done_init->{$game_name};
+ }
return;
}