summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-24 18:50:14 -0500
committerdoy <doy@tozt.net>2009-01-24 18:50:14 -0500
commitdfd11a941cf5412f9f2a626030733c289b2acbc2 (patch)
tree949a8c3e283b59b73d59c5ded266afb8ccb133a2
parente8e2c672e99c435b66cc4f2ccc7b198fc4ae91ca (diff)
downloadbot-games-dfd11a941cf5412f9f2a626030733c289b2acbc2.tar.gz
bot-games-dfd11a941cf5412f9f2a626030733c289b2acbc2.zip
don't force loading of all game plugins whenever one is called
-rw-r--r--lib/Bot/Games.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index c5039c2..e97644a 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -4,7 +4,6 @@ use Bot::Games::OO;
use Module::Pluggable
search_path => 'Bot::Games::Game',
except => ['Bot::Games::Game::Ghostlike'],
- require => 1,
sub_name => 'games';
extends 'Bot::BasicBot';
@@ -43,7 +42,9 @@ sub said {
my $output;
my $game = $self->active_games->{$game_name};
if (!defined $game || !defined $action) {
- $game = $self->game_package($game_name)->new;
+ my $game_package = $self->game_package($game_name);
+ eval "require $game_package";
+ $game = $game_package->new;
$self->active_games->{$game_name} = $game;
return $self->_format($game->init($args->{who}))
if $game->can('init');