fixed a bug when no one votes for a menu
authorDavid Anderson <dvander@alliedmods.net>
Sat Jun 16 22:10:22 2007 +0000 (2007-06-16)
changeset 9622ed832eea89d
parent 961 f4dcb8a85af2
child 963 a4e1aac0cfab
fixed a bug when no one votes for a menu
core/MenuManager.cpp
     1.1 --- a/core/MenuManager.cpp	Sat Jun 16 22:04:46 2007 +0000
     1.2 +++ b/core/MenuManager.cpp	Sat Jun 16 22:10:22 2007 +0000
     1.3 @@ -111,6 +111,7 @@
     1.4  	unsigned int chosen = 0;
     1.5  	unsigned int highest = 0;
     1.6  	unsigned int dup_count = 0;
     1.7 +	unsigned int total = m_Votes.size() ? m_Votes[0] : 0;
     1.8  
     1.9  	/* If we got zero votes, take a shortcut. */
    1.10  	if (m_NumVotes == 0)
    1.11 @@ -126,7 +127,6 @@
    1.12  	 */
    1.13  	unsigned int dup_array[256];
    1.14  
    1.15 -	unsigned int total = m_Votes[0];
    1.16  	for (size_t i=1; i<m_Items; i++)
    1.17  	{
    1.18  		if (m_Votes[i] > m_Votes[highest])