save doesn't create ranks accidentally anymore (fixes #73)

This commit is contained in:
def 2014-10-21 14:27:10 +02:00
parent 6bcf2bbe0d
commit e29571dd73
3 changed files with 6 additions and 3 deletions

View file

@ -1677,7 +1677,7 @@ void CSqlScore::SaveTeamThread(void *pUser)
char aBuf2[256];
str_format(aBuf2, sizeof(aBuf2), "Team successfully saved. Use '/load %s' to continue", OriginalCode);
pData->m_pSqlData->GameServer()->SendChatTeam(Team, aBuf2);
((CGameControllerDDRace*)(pData->m_pSqlData->GameServer()->m_pController))->m_Teams.KillTeam(Team);
((CGameControllerDDRace*)(pData->m_pSqlData->GameServer()->m_pController))->m_Teams.KillSavedTeam(Team);
}
else
{

View file

@ -635,8 +635,11 @@ void CGameTeams::SetTeamLock(int Team, bool Lock)
m_TeamLocked[Team] = Lock;
}
void CGameTeams::KillTeam(int Team)
void CGameTeams::KillSavedTeam(int Team)
{
// Set so that no finish is accidentally given to some of the players
ChangeTeamState(Team, CGameTeams::TEAMSTATE_OPEN);
for (int i = 0; i < MAX_CLIENTS; i++)
if(m_Core.Team(i) == Team && GameServer()->m_apPlayers[i])
GameServer()->m_apPlayers[i]->KillCharacter(-2);

View file

@ -80,7 +80,7 @@ public:
void SetCpActive(CPlayer* Player, int CpActive);
void OnTeamFinish(CPlayer** Players, unsigned int Size);
void OnFinish(CPlayer* Player);
void KillTeam(int Team);
void KillSavedTeam(int Team);
bool TeeFinished(int ClientID)
{
return m_TeeFinished[ClientID];