From 660c8da0efe62f37d3c6c95b5a267813564da6d7 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Sun, 28 May 2017 08:02:52 +0200 Subject: [PATCH] Fix rounding error in vote plurality calculation --- mp/src/game/server/vote_controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mp/src/game/server/vote_controller.cpp b/mp/src/game/server/vote_controller.cpp index e34600bdf..a113ab86c 100755 --- a/mp/src/game/server/vote_controller.cpp +++ b/mp/src/game/server/vote_controller.cpp @@ -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