mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Merge pull request #8833 from furo321/vote-creator
Set `m_VoteCreator` when possible
This commit is contained in:
commit
7df1b24491
|
@ -3140,6 +3140,8 @@ void CGameContext::ConRandomUnfinishedMap(IConsole::IResult *pResult, void *pUse
|
||||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||||
|
|
||||||
int Stars = pResult->NumArguments() ? pResult->GetInteger(0) : -1;
|
int Stars = pResult->NumArguments() ? pResult->GetInteger(0) : -1;
|
||||||
|
if(pResult->m_ClientId != -1)
|
||||||
|
pSelf->m_VoteCreator = pResult->m_ClientId;
|
||||||
|
|
||||||
pSelf->m_pScore->RandomUnfinishedMap(pSelf->m_VoteCreator, Stars);
|
pSelf->m_pScore->RandomUnfinishedMap(pSelf->m_VoteCreator, Stars);
|
||||||
}
|
}
|
||||||
|
@ -3394,6 +3396,7 @@ void CGameContext::ConForceVote(IConsole::IResult *pResult, void *pUserData)
|
||||||
{
|
{
|
||||||
str_format(aBuf, sizeof(aBuf), "authorized player forced server option '%s' (%s)", pValue, pReason);
|
str_format(aBuf, sizeof(aBuf), "authorized player forced server option '%s' (%s)", pValue, pReason);
|
||||||
pSelf->SendChatTarget(-1, aBuf, FLAG_SIX);
|
pSelf->SendChatTarget(-1, aBuf, FLAG_SIX);
|
||||||
|
pSelf->m_VoteCreator = pResult->m_ClientId;
|
||||||
pSelf->Console()->ExecuteLine(pOption->m_aCommand);
|
pSelf->Console()->ExecuteLine(pOption->m_aCommand);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue