summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games.pm
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-25 16:52:07 -0500
committerdoy <doy@tozt.net>2009-01-25 16:52:07 -0500
commit99ef5f93750eb53c4b976a710c7e5a2fdcdeb8f6 (patch)
tree1e90d78f7c49489730f8b141ef709dfcb2ec4bb3 /lib/Bot/Games.pm
parent90b080af6b0e42b817413e9da6484311cdae18d0 (diff)
downloadbot-games-99ef5f93750eb53c4b976a710c7e5a2fdcdeb8f6.tar.gz
bot-games-99ef5f93750eb53c4b976a710c7e5a2fdcdeb8f6.zip
allow marking commands as requiring an init call before being called - default everything to this
Diffstat (limited to 'lib/Bot/Games.pm')
-rw-r--r--lib/Bot/Games.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index 654f288..ad65db8 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -77,6 +77,10 @@ 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;
+ }
$self->$say($method_meta->execute($game, $arg,
{player => $args->{who}}));
}