| 154 | } |
| 155 | |
| 156 | void VoteMenuHandler::OnClientDisconnected(int client) |
| 157 | { |
| 158 | if (!IsVoteInProgress()) |
| 159 | { |
| 160 | return; |
| 161 | } |
| 162 | |
| 163 | /* Wipe out their vote if they had one. We have to make sure the the the |
| 164 | * newly connected client is not allowed to vote. |
| 165 | */ |
| 166 | int item; |
| 167 | if ((item = m_ClientVotes[client]) >= VOTE_PENDING) |
| 168 | { |
| 169 | if (item >= 0) |
| 170 | { |
| 171 | assert((unsigned)item < m_Items); |
| 172 | assert(m_Votes[item] > 0); |
| 173 | m_Votes[item]--; |
| 174 | |
| 175 | if (sm_vote_hintbox.GetBool()) |
| 176 | { |
| 177 | BuildVoteLeaders(); |
| 178 | DrawHintProgress(); |
| 179 | } |
| 180 | } |
| 181 | m_ClientVotes[client] = VOTE_NOT_VOTING; |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | bool VoteMenuHandler::IsVoteInProgress() |
| 186 | { |
no test coverage detected