From 47100dd2ebca494202037a91bc466efadb7d22bb Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 9 Mar 2015 00:40:34 -0400 Subject: [PATCH] fix doing !roles default when in another game mode has to check ORIGINAL_SETTINGS to get them since 'default' itself doesn't define any settings --- modules/wolfgame.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 43a0c76..3dee122 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -6658,10 +6658,12 @@ def listroles(cli, nick, chan, rest): gamemode, _ = complete_match(rest[0], var.GAME_MODES.keys() - ["roles"]) if gamemode in var.GAME_MODES.keys() and gamemode != "roles" and not var.GAME_MODES[gamemode][4]: mode = var.GAME_MODES[gamemode][0]() - if hasattr(mode, "ROLE_INDEX"): + if hasattr(mode, "ROLE_INDEX") and hasattr(mode, "ROLE_GUIDE"): roleindex = getattr(mode, "ROLE_INDEX") - if hasattr(mode, "ROLE_GUIDE"): roleguide = getattr(mode, "ROLE_GUIDE") + elif gamemode == "default" and "ROLE_INDEX" in var.ORIGINAL_SETTINGS and "ROLE_GUIDE" in var.ORIGINAL_SETTINGS: + roleindex = var.ORIGINAL_SETTINGS["ROLE_INDEX"] + roleguide = var.ORIGINAL_SETTINGS["ROLE_GUIDE"] rest.pop(0) else: if gamemode in var.GAME_MODES and var.GAME_MODES[gamemode][4]: