Browse Source

prevent crashing if !fgame is given invalid arguments

master
Jimmy Cao 12 years ago
parent
commit
52154b9413
  1. 5
      modules/wolfgame.py
  2. 6
      settings/wolfgame.py

5
modules/wolfgame.py

@ -2071,6 +2071,11 @@ def cgamemode(cli, *args): @@ -2071,6 +2071,11 @@ def cgamemode(cli, *args):
for arg in args:
modeargs = arg.split("=", 1)
if len(modeargs) < 2: # no equal sign in the middle of the arg
cli.msg(botconfig.CHANNEL, "Invalid syntax.")
return False
modeargs[0] = modeargs[0].strip()
if modeargs[0] in var.GAME_MODES.keys():
md = modeargs.pop(0)

6
settings/wolfgame.py

@ -125,11 +125,7 @@ CHANGEABLE_ROLES = { "seers" : INDEX_OF_ROLE["seer"], @@ -125,11 +125,7 @@ CHANGEABLE_ROLES = { "seers" : INDEX_OF_ROLE["seer"],
"angels" : INDEX_OF_ROLE["guardian angel"],
"detectives" : INDEX_OF_ROLE["detective"]}
@game_mode("normal")
class Normal(object):
pass
# TODO: implement game modes

Loading…
Cancel
Save