fix crash when shaman exchanges roles with themselves

This commit is contained in:
jacob1 2015-03-27 14:51:30 -04:00
parent 0e020c3d15
commit ad8f3a720a

View File

@ -3923,6 +3923,9 @@ def choose_target(actor, nick):
# returns true if a swap happened # returns true if a swap happened
# check for that to short-circuit the nightrole # check for that to short-circuit the nightrole
def check_exchange(cli, actor, nick): def check_exchange(cli, actor, nick):
#some roles can act on themselves, ignore this
if actor == nick:
return False
if nick in var.EXCHANGED: if nick in var.EXCHANGED:
var.EXCHANGED.remove(nick) var.EXCHANGED.remove(nick)
actor_role = var.get_role(actor) actor_role = var.get_role(actor)