mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Reset practice when loading team (fixes #4894)
I hope this doesn't give a chance to cheat. We also reset practice when killing a team, so loading can be considered as similar to killing?
This commit is contained in:
parent
ebc714fa7f
commit
b96b23d9cb
|
@ -667,7 +667,7 @@ void CGameContext::ConPractice(IConsole::IResult *pResult, void *pUserData)
|
|||
|
||||
if(NumCurrentVotes >= NumRequiredVotes)
|
||||
{
|
||||
Teams.EnablePractice(Team);
|
||||
Teams.SetPractice(Team, true);
|
||||
pSelf->SendChatTeam(Team, "Practice mode enabled for your team, happy practicing!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -517,8 +517,7 @@ void CSaveTeam::Load(int Team, bool KeepCurrentWeakStrong)
|
|||
|
||||
pTeams->ChangeTeamState(Team, m_TeamState);
|
||||
pTeams->SetTeamLock(Team, m_TeamLocked);
|
||||
if(m_Practice)
|
||||
pTeams->EnablePractice(Team);
|
||||
pTeams->SetPractice(Team, m_Practice);
|
||||
|
||||
for(int i = m_MembersCount; i-- > 0;)
|
||||
{
|
||||
|
|
|
@ -183,14 +183,14 @@ public:
|
|||
return m_pSaveTeamResult[TeamID] != nullptr;
|
||||
}
|
||||
|
||||
void EnablePractice(int Team)
|
||||
void SetPractice(int Team, bool Enabled)
|
||||
{
|
||||
if(Team < TEAM_FLOCK || Team >= TEAM_SUPER)
|
||||
return;
|
||||
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && Team == TEAM_FLOCK)
|
||||
return;
|
||||
|
||||
m_Practice[Team] = true;
|
||||
m_Practice[Team] = Enabled;
|
||||
}
|
||||
|
||||
bool IsPractice(int Team)
|
||||
|
|
Loading…
Reference in a new issue