Remove the roles_check event

This commit is contained in:
Vgr E.Barry 2015-06-15 10:29:04 -04:00
parent d8161271c7
commit 7f875d3b33

View File

@ -5957,25 +5957,25 @@ def start(cli, nick, chan, forced = False, restart = ""):
return return
if var.ORIGINAL_SETTINGS and not restart: # Custom settings if var.ORIGINAL_SETTINGS and not restart: # Custom settings
event = Event("roles_check", {"addroles": addroles}) need_reset = True
if event.dispatch(var): wvs = sum(addroles[r] for r in var.WOLFCHAT_ROLES)
need_reset = True if len(villagers) < (sum(addroles.values()) - sum(addroles[r] for r in var.TEMPLATE_RESTRICTIONS.keys())):
wvs = sum(addroles[r] for r in var.WOLFCHAT_ROLES) cli.msg(chan, "There are too few players in the "+
if len(villagers) < (sum(addroles.values()) - sum(addroles[r] for r in var.TEMPLATE_RESTRICTIONS.keys())): "game to use the custom roles.")
cli.msg(chan, "There are too few players in the "+ elif not wvs:
"game to use the custom roles.") cli.msg(chan, "There has to be at least one wolf!")
elif not wvs: elif wvs > (len(villagers) / 2):
cli.msg(chan, "There has to be at least one wolf!") cli.msg(chan, "Too many wolves.")
elif wvs > (len(villagers) / 2): elif set(addroles) != set(var.ROLE_GUIDE):
cli.msg(chan, "Too many wolves.") cli.msg(chan, "Error: Not all roles have defined player counts.")
else: else:
need_reset = False need_reset = False
if need_reset: if need_reset:
reset_settings() reset_settings()
cli.msg(chan, "The default settings have been restored. Please !start again.") cli.msg(chan, "The default settings have been restored. Please !start again.")
var.PHASE = "join" var.PHASE = "join"
return return
if var.ADMIN_TO_PING and not restart: if var.ADMIN_TO_PING and not restart:
for decor in (COMMANDS.get("join", []) + COMMANDS.get("start", [])): for decor in (COMMANDS.get("join", []) + COMMANDS.get("start", [])):