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 3.0 Indev
=============================================================================== ===============================================================================
* Werewolf: Fixed a bug causing double lynches occasionally.
* Werewolf: One bug fix and multiple bullets. * Werewolf: One bug fix and multiple bullets.
* Werewolf: Fixed timeout bug. * Werewolf: Fixed timeout bug.
* Werewolf: Fixed various warnings. * Werewolf: Fixed various warnings.
+6 -4
View File
@@ -1204,7 +1204,7 @@ sub _judgment {
# Kill him/her! # Kill him/her!
my ($gsvr, $gchan) = split '/', $GAMECHAN; 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."); 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. # Initialize nighttime.
if ($ri) { _init_night() } if ($ri) { _init_night() }
@@ -1276,7 +1276,7 @@ sub _getrole {
# Delete a player. # Delete a player.
sub _player_del { sub _player_del {
my ($player) = @_; my ($player, $judgment) = @_;
my ($gsvr, $gchan) = split '/', $GAMECHAN; my ($gsvr, $gchan) = split '/', $GAMECHAN;
# Devoice them. # Devoice them.
@@ -1307,8 +1307,10 @@ sub _player_del {
# Update LVOTEN. # Update LVOTEN.
if ($LVOTEN) { $LVOTEN-- } if ($LVOTEN) { $LVOTEN-- }
# Call lynch management. # Call lynch management IF judgment did not call us.
if ($PHASE) { if ($PHASE eq 'd') { _lynchmng() } } if ($PHASE and !$judgment) {
if ($PHASE eq 'd') { _lynchmng() }
}
# Check for winning conditions. # Check for winning conditions.
if (!$PGAME) { if (!$PGAME) {