summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games.pm
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-25 02:19:04 -0500
committerdoy <doy@tozt.net>2009-01-25 02:19:04 -0500
commit8a875ee303a3533011c7e0d5326de86d6ffdc5ea (patch)
tree36e06f6e73c860c45ac5c6013509a97e6d76fab6 /lib/Bot/Games.pm
parentda639d92d2e1b815c529487e5d0259787bd9e0c1 (diff)
downloadbot-games-8a875ee303a3533011c7e0d5326de86d6ffdc5ea.tar.gz
bot-games-8a875ee303a3533011c7e0d5326de86d6ffdc5ea.zip
make sure $action is defined before matching against it
Diffstat (limited to 'lib/Bot/Games.pm')
-rw-r--r--lib/Bot/Games.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index 0668113..5e84fd4 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -56,7 +56,8 @@ sub said {
$self->active_games->{$game_name} = $game;
$self->done_init->{$game_name} = 0;
}
- if (!$self->done_init->{$game_name} && $action !~ /^-/) {
+ if (!$self->done_init->{$game_name}
+ && (!defined($action) || $action !~ /^-/)) {
$say->($game->init($args->{who})) if $game->can('init');
$self->done_init->{$game_name} = 1;
}