Make the bite command make use of the new get_victim function

This commit is contained in:
skizzerz 2014-12-17 20:37:57 -06:00
parent d42fa45d2f
commit 93f5c6a4f8

View File

@ -4490,31 +4490,13 @@ def bite_cmd(cli, nick, rest):
pm(cli, nick, "You may only bite someone after another wolf has died during the day.") pm(cli, nick, "You may only bite someone after another wolf has died during the day.")
return return
victim = get_victim(cli, nick, re.split(" +",rest)[0], False)
pieces = [p.strip().lower() for p in re.split(" +",rest)]
victim = pieces[0]
if var.ANGRY_WOLVES: if var.ANGRY_WOLVES:
if not victim: if not victim:
pm(cli, nick, "Please choose who to bite by specifying their nick.") pm(cli, nick, "Please choose who to bite by specifying their nick.")
return return
pl = var.list_players()
pll = [x.lower() for x in pl]
matches = 0
for player in pll:
if victim == player:
target = player
break
if player.startswith(victim):
target = player
matches += 1
else:
if matches != 1:
pm(cli, nick, "\u0002{0}\u0002 is currently not playing.".format(victim))
return
victim = pl[pll.index(target)]
vrole = var.get_role(victim) vrole = var.get_role(victim)
if vrole in var.WOLFCHAT_ROLES: if vrole in var.WOLFCHAT_ROLES: