I think I finally fixed it

This commit is contained in:
James Scott 2012-12-16 20:36:55 -05:00
parent 194762d4fc
commit 4bb70b05e8
1 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ class Cah(callbacks.Plugin):
canidatesById.append(nick)
for canidateNumber, count in votes.iteritems():
canidate = canidatesById[canidateNumber]
canidate = canidatesById[int(canidateNumber)]
if len(winningCanidate) == 0:
winningCanidate.append((canidate, count))
elif winningCanidate[0][1] < count:
@ -122,7 +122,7 @@ class Cah(callbacks.Plugin):
winningCanidate.append((canidate, count))
if len(winningCanidate) > 0:
return (winningCanidate[randint(0, len(ties) -1)], True)
return (winningCanidate[randint(0, len(winningCanidate) -1)], True)
return (winningCanidate[0], False)