Fix crash on nickchange if the user is being killed by wolves or is a lover

This commit is contained in:
skizzerz 2014-07-25 08:27:34 -05:00
parent f185556680
commit ddbeff5977

View File

@ -1690,24 +1690,20 @@ def on_nick(cli, prefix, nick):
if prefix in dictvar.keys(): if prefix in dictvar.keys():
dictvar[nick] = dictvar[prefix] dictvar[nick] = dictvar[prefix]
del dictvar[prefix] del dictvar[prefix]
for a,b in (list(var.KILLS.items()) + list(var.LOVERS.items())): for dictvar in (var.KILLS, var.LOVERS):
kvp = [] kvp = []
if a == prefix: for a,b in dictvar.items():
a = nick
try:
nl = [] nl = []
for n in b: for n in b:
if n == prefix: if n == prefix:
n = nick n = nick
nl.append(n) nl.append(n)
b = nl if a == prefix:
except TypeError: a = nick
if b == prefix: kvp.append((a,nl))
b = nick dictvar.update(kvp)
kvp.append((a,b)) if prefix in dictvar.keys():
var.KILLS.update(kvp) del dictvar[prefix]
if prefix in var.KILLS.keys():
del var.KILLS[prefix]
if prefix in var.SEEN: if prefix in var.SEEN:
var.SEEN.remove(prefix) var.SEEN.remove(prefix)
var.SEEN.append(nick) var.SEEN.append(nick)