Don't add player's current poll to the queue

This commit is contained in:
Shaun Bennett 2014-08-17 18:11:55 -05:00
parent 34ffc06166
commit 36d5c2c3af
2 changed files with 14 additions and 2 deletions

View File

@ -46,4 +46,14 @@ public class Poll
{
return _coinReward;
}
@Override
public boolean equals(Object object)
{
if (object instanceof Poll)
{
return ((Poll) object).getId() == getId();
}
return false;
}
}

View File

@ -123,8 +123,10 @@ public class PollManager extends MiniClientPlugin<PlayerPollData>
for (Poll poll : _polls)
{
if (!pollData.hasAnswered(poll))
pollQueue.add(poll);
if (poll.equals(pollData.getCurrentPoll()) || pollData.hasAnswered(poll))
continue;
pollQueue.add(poll);
}
}