From 412261f478c38b03c7df4785155a429b1ca8e78d Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Wed, 20 Apr 2011 21:36:11 -0600 Subject: [PATCH] Werewolf: Various bug fixes. --- doc/CHANGELOG | 1 + modules/Werewolf.pm | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 0e02a4a..45540c0 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * Werewolf: Various bug fixes. * Werewolf 1.06: Fixed an annoyance and added traitor transformation. * Commands now work with prefixes even in PM. * Ping: Determines end by numeric 315 instead of a 3-second timer now. diff --git a/modules/Werewolf.pm b/modules/Werewolf.pm index 574ca7b..df5855f 100644 --- a/modules/Werewolf.pm +++ b/modules/Werewolf.pm @@ -712,6 +712,12 @@ sub cmd_wolf { return; } + # Check if the target is playing. + if (!exists $PLAYERS{lc $argv[1]}) { + notice($src->{svr}, $src->{nick}, "\2$argv[1]\2 is not currently playing."); + return; + } + # Kill the target. privmsg($src->{svr}, $src->{chan}, "\2$argv[1]\2 died of an unknown disease. He/She was a \2"._getrole(lc $argv[1], 2)."\2."); _player_del(lc $argv[1]); @@ -1592,7 +1598,14 @@ sub on_uprivmsg { $COMMANDS{kill} !~ m/^WOLF\sKILL/xsmi) { return 1 } # All good. - privmsg($src->{svr}, $NICKS{$plyr}, "\2$src->{nick}\2 says: ".join(q{ }, @msg)); + if ($msg[0] =~ m/^\001ACTION/xsm) { + shift @msg; + $msg[$#msg] =~ s/\001$//xsm; + privmsg($src->{svr}, $NICKS{$plyr}, "* \2$src->{nick}\2 ".join(q{ }, @msg)); + } + else { + privmsg($src->{svr}, $NICKS{$plyr}, "\2$src->{nick}\2 says: ".join(q{ }, @msg)); + } } } }