mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Merge pull request #8904 from furo321/fix-force-yes
Fix `random_unfinished_map` not working with `vote yes`
This commit is contained in:
commit
0948a53648
|
@ -779,7 +779,6 @@ void CGameContext::StartVote(const char *pDesc, const char *pCommand, const char
|
||||||
{
|
{
|
||||||
// reset votes
|
// reset votes
|
||||||
m_VoteEnforce = VOTE_ENFORCE_UNKNOWN;
|
m_VoteEnforce = VOTE_ENFORCE_UNKNOWN;
|
||||||
m_VoteEnforcer = -1;
|
|
||||||
for(auto &pPlayer : m_apPlayers)
|
for(auto &pPlayer : m_apPlayers)
|
||||||
{
|
{
|
||||||
if(pPlayer)
|
if(pPlayer)
|
||||||
|
@ -1210,7 +1209,7 @@ void CGameContext::OnTick()
|
||||||
}
|
}
|
||||||
else if(m_VoteEnforce == VOTE_ENFORCE_YES_ADMIN)
|
else if(m_VoteEnforce == VOTE_ENFORCE_YES_ADMIN)
|
||||||
{
|
{
|
||||||
Console()->ExecuteLine(m_aVoteCommand, m_VoteEnforcer);
|
Console()->ExecuteLine(m_aVoteCommand, m_VoteCreator);
|
||||||
SendChat(-1, TEAM_ALL, "Vote passed enforced by authorized player", -1, FLAG_SIX);
|
SendChat(-1, TEAM_ALL, "Vote passed enforced by authorized player", -1, FLAG_SIX);
|
||||||
EndVote();
|
EndVote();
|
||||||
}
|
}
|
||||||
|
@ -4832,7 +4831,6 @@ void CGameContext::ForceVote(int EnforcerId, bool Success)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_VoteEnforce = Success ? CGameContext::VOTE_ENFORCE_YES_ADMIN : CGameContext::VOTE_ENFORCE_NO_ADMIN;
|
m_VoteEnforce = Success ? CGameContext::VOTE_ENFORCE_YES_ADMIN : CGameContext::VOTE_ENFORCE_NO_ADMIN;
|
||||||
m_VoteEnforcer = EnforcerId;
|
|
||||||
|
|
||||||
char aBuf[256];
|
char aBuf[256];
|
||||||
const char *pOption = Success ? "yes" : "no";
|
const char *pOption = Success ? "yes" : "no";
|
||||||
|
|
|
@ -576,7 +576,6 @@ public:
|
||||||
VOTE_TYPE_SPECTATE,
|
VOTE_TYPE_SPECTATE,
|
||||||
};
|
};
|
||||||
int m_VoteVictim;
|
int m_VoteVictim;
|
||||||
int m_VoteEnforcer;
|
|
||||||
|
|
||||||
inline bool IsOptionVote() const { return m_VoteType == VOTE_TYPE_OPTION; }
|
inline bool IsOptionVote() const { return m_VoteType == VOTE_TYPE_OPTION; }
|
||||||
inline bool IsKickVote() const { return m_VoteType == VOTE_TYPE_KICK; }
|
inline bool IsKickVote() const { return m_VoteType == VOTE_TYPE_KICK; }
|
||||||
|
|
Loading…
Reference in a new issue