summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games.pm
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-24 01:24:23 -0500
committerdoy <doy@tozt.net>2009-01-24 01:24:23 -0500
commit84edd7dca442e498f0898e4ce1ddcd227a41b1b1 (patch)
treebbdd5e684e41d433793411da795d0ef2621eee62 /lib/Bot/Games.pm
parent85f894a1aa35d771e0232c6e44850b9b6a9c5dcf (diff)
downloadbot-games-84edd7dca442e498f0898e4ce1ddcd227a41b1b1.tar.gz
bot-games-84edd7dca442e498f0898e4ce1ddcd227a41b1b1.zip
don't always format, that catches unintentional undef returns
Diffstat (limited to 'lib/Bot/Games.pm')
-rw-r--r--lib/Bot/Games.pm8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index b2d0f2d..a1dce91 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -54,13 +54,14 @@ sub said {
else {
$output = $game->$action;
}
+ $output = $self->_format($output);
}
else {
$output = "Unknown command $action for game $game_name";
}
}
else {
- $output = $game->turn($args->{who}, $action);
+ $output = $self->_format($game->turn($args->{who}, $action));
}
if (my $end_msg = $game->is_over) {
@@ -71,11 +72,6 @@ sub said {
}
return $output;
}
-around said => sub {
- my $orig = shift;
- my $self = shift;
- return $self->_format($self->$orig(@_));
-};
sub valid_game {
my $self = shift;