Fix bug where night would abruptly end if there are no wolves alive to receive gun.
This commit is contained in:
parent
d34a65dd98
commit
6ee671f903
@ -2521,6 +2521,7 @@ def transition_day(cli, gameid=0):
|
||||
|
||||
if var.WOLF_STEALS_GUN and victim in bywolves and victim in var.GUNNERS.keys() and var.GUNNERS[victim] > 0:
|
||||
# victim has bullets
|
||||
try:
|
||||
while True:
|
||||
guntaker = random.choice(var.list_players(var.WOLFCHAT_ROLES)) # random looter
|
||||
if guntaker not in dead:
|
||||
@ -2534,6 +2535,8 @@ def transition_day(cli, gameid=0):
|
||||
"If you shoot a villager, it is likely that they will be injured.")
|
||||
mmsg = mmsg.format(victim)
|
||||
pm(cli, guntaker, mmsg)
|
||||
except IndexError:
|
||||
pass # no wolves to give gun to (they were all killed during night or something)
|
||||
var.GUNNERS[victim] = 0 # just in case
|
||||
|
||||
for havetotem in havetotem.values():
|
||||
|
Loading…
x
Reference in New Issue
Block a user