Fix for multi-word roles.

Also added help definition for "mystats" command.
This commit is contained in:
Yizhe Shen 2014-02-09 21:12:25 -05:00
parent cbae0291f8
commit a12128b486

View File

@ -2902,7 +2902,7 @@ def game_stats(cli, nick, chan, rest):
@cmd("player", "p") @cmd("player", "p")
def player_stats(cli, nick, chan, rest): def player_stats(cli, nick, chan, rest):
"""Gets the specified player's stats based on role""" """Gets the stats for the specified player and role."""
if var.PHASE not in ("none", "join"): if var.PHASE not in ("none", "join"):
cli.notice(nick, "Wait until the game is over to view stats.") cli.notice(nick, "Wait until the game is over to view stats.")
return return
@ -2913,7 +2913,7 @@ def player_stats(cli, nick, chan, rest):
return return
player = params[0] player = params[0]
role = params[1] role = " ".join(params[1:])
msg = var.get_player_stats(player, role) msg = var.get_player_stats(player, role)
if msg == "": if msg == "":
@ -2931,6 +2931,11 @@ def my_stats_pm(cli, nick, rest):
@cmd("mystats", "me") @cmd("mystats", "me")
def my_stats(cli, nick, chan, rest): def my_stats(cli, nick, chan, rest):
"""Gets the your own stats for the specified role."""
if rest == "":
cli.notice(nick, "Supply a role.")
return
player_stats(cli, nick, chan, "{0} {1}".format(nick, rest)) player_stats(cli, nick, chan, "{0} {1}".format(nick, rest))