fix players not being removed from var.KILLS when they die, and revert f8574e18928f

This commit is contained in:
jacob1 2014-09-05 19:44:46 -04:00
parent 250e7d7462
commit e84e786d39

View File

@ -1623,9 +1623,10 @@ def del_player(cli, nick, forced_death = False, devoice = True, end_game = True,
if var.PHASE in ("night", "day") and ret:
# remove the player from variables if they're in there
for a,b in list(var.KILLS.items()):
if b == nick:
del var.KILLS[a]
elif a == nick:
for n in b: #var.KILLS can have 2 kills in a list
if n == nick:
var.KILLS[a].remove(nick)
if a == nick or len(var.KILLS[a]) == 0:
del var.KILLS[a]
for x in (var.OBSERVED, var.HVISITED, var.GUARDED, var.TARGETED, var.LASTGUARDED, var.LASTGIVEN):
keys = list(x.keys())
@ -2512,12 +2513,8 @@ def transition_day(cli, gameid=0):
message.append(("\u0002{0}\u0002's totem emitted a brilliant flash of light last night. " +
"The dead body of \u0002{1}\u0002 was found at the scene.").format(victim, loser))
var.LOGGER.logBare(loser, "RETRIBUTION")
try:
role = var.get_reveal_role(victim)
except KeyError:
pass # Already died somehow
else:
if var.ROLE_REVEAL:
role = var.get_reveal_role(victim)
an = "n" if role[0] in ("a", "e", "i", "o", "u") else ""
message.append(("The dead body of \u0002{0}\u0002, a{1} \u0002{2}\u0002, is found. " +
"Those remaining mourn the tragedy.").format(victim, an, role))