fixed server crash on remove vote

This commit is contained in:
oy 2011-04-04 16:58:53 +02:00
parent 9cb2f07b80
commit 0046825953

View file

@ -1140,6 +1140,11 @@ void CGameContext::ConRemoveVote(IConsole::IResult *pResult, void *pUserData)
return; return;
} }
// inform clients about removed option
CNetMsg_Sv_VoteOptionRemove OptionMsg;
OptionMsg.m_pDescription = pOption->m_aDescription;
pSelf->Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, -1);
// TODO: improve this // TODO: improve this
// remove the option // remove the option
--pSelf->m_NumVoteOptions; --pSelf->m_NumVoteOptions;
@ -1177,11 +1182,6 @@ void CGameContext::ConRemoveVote(IConsole::IResult *pResult, void *pUserData)
pSelf->m_pVoteOptionFirst = pVoteOptionFirst; pSelf->m_pVoteOptionFirst = pVoteOptionFirst;
pSelf->m_pVoteOptionLast = pVoteOptionLast; pSelf->m_pVoteOptionLast = pVoteOptionLast;
pSelf->m_NumVoteOptions = NumVoteOptions; pSelf->m_NumVoteOptions = NumVoteOptions;
// inform clients about removed option
CNetMsg_Sv_VoteOptionRemove OptionMsg;
OptionMsg.m_pDescription = pOption->m_aDescription;
pSelf->Server()->SendPackMsg(&OptionMsg, MSGFLAG_VITAL, -1);
} }
void CGameContext::ConForceVote(IConsole::IResult *pResult, void *pUserData) void CGameContext::ConForceVote(IConsole::IResult *pResult, void *pUserData)