Werewolf: Fixed a bug causing double lynches occasionally.

This commit is contained in:
Elijah Perrault committed 2011-04-13 14:45:06 -06:00
1 parent 743bee7424
commit 1adcd0323b
2 files changed
+7 -4

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
===============================================================================
* Werewolf: Fixed a bug causing double lynches occasionally.
* Werewolf: One bug fix and multiple bullets.
* Werewolf: Fixed timeout bug.
* Werewolf: Fixed various warnings.
+6 -4
View File
@@ -1204,7 +1204,7 @@ sub _judgment {
# Kill him/her!
my ($gsvr, $gchan) = split '/', $GAMECHAN;
privmsg($gsvr, $gchan, "The villagers, after much debate, finally decide on lynching \2$NICKS{$nick}\2, who turned out to be... a \2"._getrole($nick, 2)."\2.");
my $ri = _player_del($nick);
my $ri = _player_del($nick, 1);
# Initialize nighttime.
if ($ri) { _init_night() }
@@ -1276,7 +1276,7 @@ sub _getrole {
# Delete a player.
sub _player_del {
my ($player) = @_;
my ($player, $judgment) = @_;
my ($gsvr, $gchan) = split '/', $GAMECHAN;
# Devoice them.
@@ -1307,8 +1307,10 @@ sub _player_del {
# Update LVOTEN.
if ($LVOTEN) { $LVOTEN-- }
# Call lynch management.
if ($PHASE) { if ($PHASE eq 'd') { _lynchmng() } }
# Call lynch management IF judgment did not call us.
if ($PHASE and !$judgment) {
if ($PHASE eq 'd') { _lynchmng() }
}
# Check for winning conditions.
if (!$PGAME) {