# HG changeset patch # User Adam Kaminski # Date 1635030562 14400 # Sat Oct 23 19:09:22 2021 -0400 # Node ID 4b110185269e4214ce3eab17a7763a140d18f140 # Parent 04233c24b3921d472e37bddea4a51c5ce998d87a Fixed player names appearing incorrectly on the classic vote screen. diff -r 04233c24b392 -r 4b110185269e src/callvote.cpp --- a/src/callvote.cpp Wed Oct 20 21:30:37 2021 -0400 +++ b/src/callvote.cpp Sat Oct 23 19:09:22 2021 -0400 @@ -251,6 +251,7 @@ ULONG *pulPlayersWhoVotedYes = CALLVOTE_GetPlayersWhoVotedYes( ); ULONG *pulPlayersWhoVotedNo = CALLVOTE_GetPlayersWhoVotedNo( ); ULONG ulMaxYesOrNoVoters = ( MAXPLAYERS / 2 ) + 1; + ULONG ulPlayer; FString text; // Start with the "VOTE NOW!" title. @@ -293,10 +294,12 @@ // [AK] Show a list of all the players who voted yes. for ( ULONG ulIdx = 0; ulIdx < ulMaxYesOrNoVoters; ulIdx++ ) { - if ( pulPlayersWhoVotedYes[ulIdx] != MAXPLAYERS ) + ulPlayer = pulPlayersWhoVotedYes[ulIdx]; + + if ( ulPlayer != MAXPLAYERS ) { ulYPos += 8; - text.Format( "%s", players[ulIdx].userinfo.GetName( )); + text.Format( "%s", players[ulPlayer].userinfo.GetName( )); HUD_DrawTextClean( SmallFont, CR_UNTRANSLATED, 32, ulYPos, text ); } } @@ -306,10 +309,12 @@ // [AK] Next, show another list with all the players who voted no. for ( ULONG ulIdx = 0; ulIdx < ulMaxYesOrNoVoters; ulIdx++ ) { - if ( pulPlayersWhoVotedNo[ulIdx] != MAXPLAYERS ) + ulPlayer = pulPlayersWhoVotedNo[ulIdx]; + + if ( ulPlayer != MAXPLAYERS ) { ulYPos += 8; - text.Format( "%s", players[ulIdx].userinfo.GetName( )); + text.Format( "%s", players[ulPlayer].userinfo.GetName( )); HUD_DrawTextClean( SmallFont, CR_UNTRANSLATED, 320 - 32 - SmallFont->StringWidth( text ), ulYPos, text ); } }