From 06e296bdda0c127622aef2aadf336c0dc506c4bc Mon Sep 17 00:00:00 2001 From: doy Date: Sun, 25 Jan 2009 16:57:37 -0500 Subject: don't automatically call the init method if a needs_init command is called - just print a warning and ignore it --- lib/Bot/Games.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Bot/Games.pm') diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm index ad65db8..f981c27 100644 --- a/lib/Bot/Games.pm +++ b/lib/Bot/Games.pm @@ -77,9 +77,9 @@ sub said { # XXX: maybe the meta stuff should get pushed out into the plugins # themselves, and this should become $game->meta->get_command or so? if (my $method_meta = _get_command($game, $action)) { - if ($method_meta->needs_init) { - $self->$say($game->init($args->{who})) if $game->can('init'); - $self->done_init->{$game_name} = 1; + if ($method_meta->needs_init && !$self->done_init->{$game_name}) { + $self->$say("Game $game_name hasn't started yet!"); + return; } $self->$say($method_meta->execute($game, $arg, {player => $args->{who}})); -- cgit v1.2.3-54-g00ecf