From 35c13983df37840b48c96f5643baa8d60caf33fa Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 16 Jun 2007 22:10:22 +0000 Subject: [PATCH] fixed a bug when no one votes for a menu --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40968 --- core/MenuManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/MenuManager.cpp b/core/MenuManager.cpp index b5cb2126..15163999 100644 --- a/core/MenuManager.cpp +++ b/core/MenuManager.cpp @@ -111,6 +111,7 @@ void VoteMenuHandler::EndVoting() unsigned int chosen = 0; unsigned int highest = 0; unsigned int dup_count = 0; + unsigned int total = m_Votes.size() ? m_Votes[0] : 0; /* If we got zero votes, take a shortcut. */ if (m_NumVotes == 0) @@ -126,7 +127,6 @@ void VoteMenuHandler::EndVoting() */ unsigned int dup_array[256]; - unsigned int total = m_Votes[0]; for (size_t i=1; i m_Votes[highest])