mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #4895 from def-/pr-practice-load
Reset practice when loading team (fixes #4894)
This commit is contained in:
commit
2eb403be93
|
@ -667,7 +667,7 @@ void CGameContext::ConPractice(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
|
||||||
if(NumCurrentVotes >= NumRequiredVotes)
|
if(NumCurrentVotes >= NumRequiredVotes)
|
||||||
{
|
{
|
||||||
Teams.EnablePractice(Team);
|
Teams.SetPractice(Team, true);
|
||||||
pSelf->SendChatTeam(Team, "Practice mode enabled for your team, happy practicing!");
|
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->ChangeTeamState(Team, m_TeamState);
|
||||||
pTeams->SetTeamLock(Team, m_TeamLocked);
|
pTeams->SetTeamLock(Team, m_TeamLocked);
|
||||||
if(m_Practice)
|
pTeams->SetPractice(Team, m_Practice);
|
||||||
pTeams->EnablePractice(Team);
|
|
||||||
|
|
||||||
for(int i = m_MembersCount; i-- > 0;)
|
for(int i = m_MembersCount; i-- > 0;)
|
||||||
{
|
{
|
||||||
|
|
|
@ -183,14 +183,14 @@ public:
|
||||||
return m_pSaveTeamResult[TeamID] != nullptr;
|
return m_pSaveTeamResult[TeamID] != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnablePractice(int Team)
|
void SetPractice(int Team, bool Enabled)
|
||||||
{
|
{
|
||||||
if(Team < TEAM_FLOCK || Team >= TEAM_SUPER)
|
if(Team < TEAM_FLOCK || Team >= TEAM_SUPER)
|
||||||
return;
|
return;
|
||||||
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && Team == TEAM_FLOCK)
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && Team == TEAM_FLOCK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_Practice[Team] = true;
|
m_Practice[Team] = Enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsPractice(int Team)
|
bool IsPractice(int Team)
|
||||||
|
|
Loading…
Reference in a new issue