fix bug where you couldn't use !roles at all when in the random game mode

This commit is contained in:
jacob1 2015-03-16 23:21:55 -04:00
parent 3985063b60
commit 51c0cb9188

View File

@ -6719,14 +6719,15 @@ def listroles(cli, nick, chan, rest):
old[r] = 0 old[r] = 0
rest = re.split(" +", rest.strip(), 1) rest = re.split(" +", rest.strip(), 1)
#prepend player count if called without any arguments #prepend player count if called without any arguments
if var.GAME_MODES[var.CURRENT_GAMEMODE][4]: if not len(rest[0]) and pl > 0:
txt += " {0}: {1}roles was disabled for this game mode.".format(nick, botconfig.CMD_CHAR) if var.GAME_MODES[var.CURRENT_GAMEMODE][4]:
rest = [] txt += " {0}: {1}roles was disabled for the {2} game mode.".format(nick, botconfig.CMD_CHAR, var.CURRENT_GAMEMODE)
roleindex = {} rest = []
elif not len(rest[0]) and pl > 0: roleindex = {}
txt += " {0}: There {1} \u0002{2}\u0002 playing.".format(nick, "is" if pl == 1 else "are", pl) else:
if var.PHASE in ["night", "day"]: txt += " {0}: There {1} \u0002{2}\u0002 playing.".format(nick, "is" if pl == 1 else "are", pl)
txt += " Using the {0} game mode.".format(var.CURRENT_GAMEMODE) if var.PHASE in ["night", "day"]:
txt += " Using the {0} game mode.".format(var.CURRENT_GAMEMODE)
#read game mode to get roles for #read game mode to get roles for
elif len(rest[0]) and not rest[0].isdigit(): elif len(rest[0]) and not rest[0].isdigit():
@ -6744,7 +6745,7 @@ def listroles(cli, nick, chan, rest):
rest.pop(0) rest.pop(0)
else: else:
if gamemode in var.GAME_MODES and var.GAME_MODES[gamemode][4]: if gamemode in var.GAME_MODES and var.GAME_MODES[gamemode][4]:
txt += " {0}: {1}roles was disabled for this game mode.".format(nick, botconfig.CMD_CHAR) txt += " {0}: {1}roles was disabled for the {2} game mode.".format(nick, botconfig.CMD_CHAR, gamemode)
else: else:
txt += " {0}: {1} is not a valid game mode.".format(nick, rest[0]) txt += " {0}: {1} is not a valid game mode.".format(nick, rest[0])
rest = [] rest = []