Move the try-except block in evilvillage's chk_win

This commit is contained in:
Vgr E. Barry 2015-09-09 10:04:41 -04:00
parent 384ee8495c
commit d427bd8ca4

View File

@ -207,7 +207,6 @@ class EvilVillageMode(GameMode):
lcultists = len(var.list_players(["cultist"])) lcultists = len(var.list_players(["cultist"]))
evt.stop_processing = True evt.stop_processing = True
try:
if lrealwolves == 0 and lsafes == 0: if lrealwolves == 0 and lsafes == 0:
evt.data["winner"] = "none" evt.data["winner"] = "none"
evt.data["message"] = ("Game over! All the villagers are dead, but the cult needed to sacrifice " + evt.data["message"] = ("Game over! All the villagers are dead, but the cult needed to sacrifice " +
@ -234,9 +233,11 @@ class EvilVillageMode(GameMode):
"manage to regain control of the village and dispose of the remaining " + "manage to regain control of the village and dispose of the remaining " +
"cultists.").format("more" if lsafes > lpl / 2 else "the same number of", "cultists.").format("more" if lsafes > lpl / 2 else "the same number of",
"than" if lsafes > lpl / 2 else "as") "than" if lsafes > lpl / 2 else "as")
elif evt.data["winner"][0] != "@": else:
try:
if evt.data["winner"][0] != "@":
evt.data["winner"] = None evt.data["winner"] = None
except TypeError: # means that evt.data["winner"] isn't a string or something else subscriptable except TypeError:
evt.data["winner"] = None evt.data["winner"] = None