prevent bodyguard from guarding self, this shouldn't be possible

This commit is contained in:
jacob1 2016-10-24 23:04:02 -04:00
parent 0580915150
commit 24c5e845d3

View File

@ -27,6 +27,9 @@ def guard(cli, nick, chan, rest):
victim = get_victim(cli, nick, re.split(" +",rest)[0], False, self_in_list)
if not victim:
return
if (role == "bodyguard" or not var.GUARDIAN_ANGEL_CAN_GUARD_SELF) and victim == nick:
pm(cli, nick, messages["cannot_guard_self"])
return
if role == "guardian angel" and LASTGUARDED.get(nick) == victim:
pm(cli, nick, messages["guardian_target_another"].format(victim))
return