Fix werecrow dying when wolf is shot dead at night

Previously, if a wolf was shot dead at night, any werecrows that have
observed were removed from the game without announcement, although they
would remain voiced.

For those who are curious, this is because lists are copied by reference
on assignment in Python; any changes made on the variable you assigned
the list to will be reflected in the original list. This can be avoided
by making a shallow copy of the list using `list(x)` or `x[:]`.
This commit is contained in:
nyuszika7h 2013-09-18 20:14:52 +02:00
parent ed62cbbfc9
commit 55cc34df3f

View File

@ -1391,7 +1391,7 @@ def transition_day(cli, gameid=0):
var.LOGGER.logBare(victim, "KILLED")
if victim in var.GUNNERS.keys() and var.GUNNERS[victim]: # victim had bullets!
if random.random() < var.GUNNER_KILLS_WOLF_AT_NIGHT_CHANCE:
wc = var.ROLES["werecrow"]
wc = var.ROLES["werecrow"][:]
for crow in wc:
if crow in var.OBSERVED.keys():
wc.remove(crow)