summaryrefslogtreecommitdiffstats
path: root/lib/Bot
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bot')
-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 ac5df25..be50f4d 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -1,5 +1,6 @@
package Bot::Games;
use Bot::Games::OO;
+use List::Util qw/first/;
use Module::Pluggable
search_path => 'Bot::Games::Game',
sub_name => 'games';
@@ -125,7 +126,7 @@ sub valid_game {
sub game_package {
my $self = shift;
my ($name) = @_;
- return 'Bot::Games::Game::' . ucfirst($name);
+ return first { /\Q::$name\E$/i } $self->games;
}
sub game_list {