Fix changing nicks in join phase not working

This commit is contained in:
Vgr E. Barry 2015-08-31 19:20:21 -04:00
parent e4c53906fb
commit 7702509f90

View File

@ -3152,9 +3152,11 @@ def rename_player(cli, prefix, nick):
var.ROLES[t].add(nick) var.ROLES[t].add(nick)
var.ROLES[t].remove(prefix) var.ROLES[t].remove(prefix)
if var.PHASE in ("night", "day"): if prefix in var.ALL_PLAYERS:
# ALL_PLAYERS needs to keep its ordering for purposes of mad scientist # ALL_PLAYERS needs to keep its ordering for purposes of mad scientist
var.ALL_PLAYERS[var.ALL_PLAYERS.index(prefix)] = nick var.ALL_PLAYERS[var.ALL_PLAYERS.index(prefix)] = nick
if var.PHASE in ("night", "day"):
for k,v in var.ORIGINAL_ROLES.items(): for k,v in var.ORIGINAL_ROLES.items():
if prefix in v: if prefix in v:
var.ORIGINAL_ROLES[k].remove(prefix) var.ORIGINAL_ROLES[k].remove(prefix)