mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix client crash with more than MAX_VOTE_OPTIONS
vote options
The server does not allow adding more than `MAX_VOTE_OPTIONS` vote options, so the client will now also refuse to add more options than that. Supersedes #6930.
This commit is contained in:
parent
0d5a853197
commit
2ea82730ae
|
@ -148,6 +148,9 @@ CVoting::CVoting()
|
||||||
|
|
||||||
void CVoting::AddOption(const char *pDescription)
|
void CVoting::AddOption(const char *pDescription)
|
||||||
{
|
{
|
||||||
|
if(m_NumVoteOptions == MAX_VOTE_OPTIONS)
|
||||||
|
return;
|
||||||
|
|
||||||
CVoteOptionClient *pOption;
|
CVoteOptionClient *pOption;
|
||||||
if(m_pRecycleFirst)
|
if(m_pRecycleFirst)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue