mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
fixed server crash on remove vote
This commit is contained in:
parent
9cb2f07b80
commit
0046825953
|
@ -1139,6 +1139,11 @@ void CGameContext::ConRemoveVote(IConsole::IResult *pResult, void *pUserData)
|
|||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
|
||||
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
|
||||
// remove the option
|
||||
|
@ -1177,11 +1182,6 @@ void CGameContext::ConRemoveVote(IConsole::IResult *pResult, void *pUserData)
|
|||
pSelf->m_pVoteOptionFirst = pVoteOptionFirst;
|
||||
pSelf->m_pVoteOptionLast = pVoteOptionLast;
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue