Skip to content

Commit

Permalink
Fix rounding error in vote plurality calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
TomyLobo committed May 28, 2017
1 parent aae5a5a commit 660c8da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mp/src/game/server/vote_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ int CVoteController::GetWinningVoteOption( void )
{
if ( m_potentialIssues[m_iActiveIssueIndex]->IsYesNoVote() )
{
float plurality = m_nVoteOptionCount[VOTE_OPTION1] / (m_nVoteOptionCount[VOTE_OPTION1] + m_nVoteOptionCount[VOTE_OPTION2]);
float plurality = m_nVoteOptionCount[VOTE_OPTION1] / (float)(m_nVoteOptionCount[VOTE_OPTION1] + m_nVoteOptionCount[VOTE_OPTION2]);
return (plurality > m_potentialIssues[m_iActiveIssueIndex]->GetRequiredPlurality()) ? VOTE_OPTION1 : VOTE_OPTION2;
}
else
Expand Down

0 comments on commit 660c8da

Please sign in to comment.