MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / OnClientDisconnected

Method OnClientDisconnected

core/MenuVoting.cpp:156–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void 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
185bool VoteMenuHandler::IsVoteInProgress()
186{

Callers 1

Calls 2

IsVoteInProgressFunction · 0.85
GetBoolMethod · 0.80

Tested by

no test coverage detected