Disallow lynching yourself
This commit is contained in:
parent
1bb3f2aefb
commit
eef1d2cd95
@ -1443,6 +1443,7 @@ def vote(cli, nick, chann_, rest):
|
|||||||
cli.msg(chan, ("{0}: You are wounded and resting, "+
|
cli.msg(chan, ("{0}: You are wounded and resting, "+
|
||||||
"thus you are unable to vote for the day.").format(nick))
|
"thus you are unable to vote for the day.").format(nick))
|
||||||
return
|
return
|
||||||
|
|
||||||
pl = var.list_players()
|
pl = var.list_players()
|
||||||
pl_l = [x.strip().lower() for x in pl]
|
pl_l = [x.strip().lower() for x in pl]
|
||||||
rest = re.split(" +",rest)[0].strip().lower()
|
rest = re.split(" +",rest)[0].strip().lower()
|
||||||
@ -1465,6 +1466,11 @@ def vote(cli, nick, chann_, rest):
|
|||||||
return
|
return
|
||||||
|
|
||||||
voted = pl[pl_l.index(target)]
|
voted = pl[pl_l.index(target)]
|
||||||
|
|
||||||
|
if nick == voted:
|
||||||
|
cli.notice(nick, "You may not vote for yourself.")
|
||||||
|
return
|
||||||
|
|
||||||
lcandidates = list(var.VOTES.keys())
|
lcandidates = list(var.VOTES.keys())
|
||||||
for voters in lcandidates: # remove previous vote
|
for voters in lcandidates: # remove previous vote
|
||||||
if nick in var.VOTES[voters]:
|
if nick in var.VOTES[voters]:
|
||||||
|
Loading…
Reference in New Issue
Block a user