force vote only if there is a vote

This commit is contained in:
SushiTee 2012-01-26 22:17:26 +01:00
parent 1a1b4a096a
commit 4b2a34e1c5

View file

@ -1385,6 +1385,11 @@ void CGameContext::ConClearVotes(IConsole::IResult *pResult, void *pUserData)
void CGameContext::ConVote(IConsole::IResult *pResult, void *pUserData) void CGameContext::ConVote(IConsole::IResult *pResult, void *pUserData)
{ {
CGameContext *pSelf = (CGameContext *)pUserData; CGameContext *pSelf = (CGameContext *)pUserData;
// check if there is a vote running
if(!pSelf->m_VoteCloseTime)
return;
if(str_comp_nocase(pResult->GetString(0), "yes") == 0) if(str_comp_nocase(pResult->GetString(0), "yes") == 0)
pSelf->m_VoteEnforce = CGameContext::VOTE_ENFORCE_YES; pSelf->m_VoteEnforce = CGameContext::VOTE_ENFORCE_YES;
else if(str_comp_nocase(pResult->GetString(0), "no") == 0) else if(str_comp_nocase(pResult->GetString(0), "no") == 0)