mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Refactoring of g_Config.m_SvTeam, See #4601
This commit is contained in:
parent
40380d088f
commit
eac2d731b6
|
@ -143,9 +143,9 @@ void CGameContext::ConSettings(IConsole::IResult *pResult, void *pUserData)
|
||||||
if(str_comp(pArg, "teams") == 0)
|
if(str_comp(pArg, "teams") == 0)
|
||||||
{
|
{
|
||||||
str_format(aBuf, sizeof(aBuf), "%s %s",
|
str_format(aBuf, sizeof(aBuf), "%s %s",
|
||||||
g_Config.m_SvTeam == 1 ?
|
g_Config.m_SvTeam == SV_TEAM_ALLOWED ?
|
||||||
"Teams are available on this server" :
|
"Teams are available on this server" :
|
||||||
(g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3) ?
|
(g_Config.m_SvTeam == SV_TEAM_FORBIDDEN || g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO) ?
|
||||||
"Teams are not available on this server" :
|
"Teams are not available on this server" :
|
||||||
"You have to be in a team to play on this server", /*g_Config.m_SvTeamStrict ? "and if you die in a team all of you die" : */
|
"You have to be in a team to play on this server", /*g_Config.m_SvTeamStrict ? "and if you die in a team all of you die" : */
|
||||||
"and all of your team will die if the team is locked");
|
"and all of your team will die if the team is locked");
|
||||||
|
@ -618,7 +618,7 @@ void CGameContext::ConPractice(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
|
||||||
int Team = Teams.m_Core.Team(pResult->m_ClientID);
|
int Team = Teams.m_Core.Team(pResult->m_ClientID);
|
||||||
|
|
||||||
if(Team < TEAM_FLOCK || (Team == TEAM_FLOCK && g_Config.m_SvTeam != 3) || Team >= TEAM_SUPER)
|
if(Team < TEAM_FLOCK || (Team == TEAM_FLOCK && g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO) || Team >= TEAM_SUPER)
|
||||||
{
|
{
|
||||||
pSelf->Console()->Print(
|
pSelf->Console()->Print(
|
||||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||||
|
@ -695,7 +695,7 @@ void CGameContext::ConSwap(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
|
||||||
int Team = Teams.m_Core.Team(pResult->m_ClientID);
|
int Team = Teams.m_Core.Team(pResult->m_ClientID);
|
||||||
|
|
||||||
if(Team < TEAM_FLOCK || (Team == TEAM_FLOCK && g_Config.m_SvTeam != 3) || Team >= TEAM_SUPER)
|
if(Team < TEAM_FLOCK || (Team == TEAM_FLOCK && g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO) || Team >= TEAM_SUPER)
|
||||||
{
|
{
|
||||||
pSelf->Console()->Print(
|
pSelf->Console()->Print(
|
||||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||||
|
@ -839,7 +839,7 @@ void CGameContext::ConLockTeam(IConsole::IResult *pResult, void *pUserData)
|
||||||
if(!CheckClientID(pResult->m_ClientID))
|
if(!CheckClientID(pResult->m_ClientID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3)
|
if(g_Config.m_SvTeam == SV_TEAM_FORBIDDEN || g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
{
|
{
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "lock",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "lock",
|
||||||
"Teams are disabled");
|
"Teams are disabled");
|
||||||
|
@ -885,7 +885,7 @@ void CGameContext::ConUnlockTeam(IConsole::IResult *pResult, void *pUserData)
|
||||||
if(!CheckClientID(pResult->m_ClientID))
|
if(!CheckClientID(pResult->m_ClientID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3)
|
if(g_Config.m_SvTeam == SV_TEAM_FORBIDDEN || g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
{
|
{
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "unlock",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "unlock",
|
||||||
"Teams are disabled");
|
"Teams are disabled");
|
||||||
|
@ -918,7 +918,7 @@ void CGameContext::ConInviteTeam(IConsole::IResult *pResult, void *pUserData)
|
||||||
CGameControllerDDRace *pController = (CGameControllerDDRace *)pSelf->m_pController;
|
CGameControllerDDRace *pController = (CGameControllerDDRace *)pSelf->m_pController;
|
||||||
const char *pName = pResult->GetString(0);
|
const char *pName = pResult->GetString(0);
|
||||||
|
|
||||||
if(g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3)
|
if(g_Config.m_SvTeam == SV_TEAM_FORBIDDEN || g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
{
|
{
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
||||||
"Teams are disabled");
|
"Teams are disabled");
|
||||||
|
@ -995,13 +995,13 @@ void CGameContext::ConJoinTeam(IConsole::IResult *pResult, void *pUserData)
|
||||||
"You are running a vote please try again after the vote is done!");
|
"You are running a vote please try again after the vote is done!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3)
|
else if(g_Config.m_SvTeam == SV_TEAM_FORBIDDEN || g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
{
|
{
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
||||||
"Teams are disabled");
|
"Teams are disabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(g_Config.m_SvTeam == 2 && pResult->GetInteger(0) == 0 && pPlayer->GetCharacter() && pPlayer->GetCharacter()->m_LastStartWarning < pSelf->Server()->Tick() - 3 * pSelf->Server()->TickSpeed())
|
else if(g_Config.m_SvTeam == SV_TEAM_MANDATORY && pResult->GetInteger(0) == 0 && pPlayer->GetCharacter() && pPlayer->GetCharacter()->m_LastStartWarning < pSelf->Server()->Tick() - 3 * pSelf->Server()->TickSpeed())
|
||||||
{
|
{
|
||||||
pSelf->Console()->Print(
|
pSelf->Console()->Print(
|
||||||
IConsole::OUTPUT_LEVEL_STANDARD,
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
||||||
|
|
|
@ -707,7 +707,7 @@ void CGameContext::ConSetDDRTeam(IConsole::IResult *pResult, void *pUserData)
|
||||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||||
CGameControllerDDRace *pController = (CGameControllerDDRace *)pSelf->m_pController;
|
CGameControllerDDRace *pController = (CGameControllerDDRace *)pSelf->m_pController;
|
||||||
|
|
||||||
if(g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3)
|
if(g_Config.m_SvTeam == SV_TEAM_FORBIDDEN || g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
{
|
{
|
||||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
||||||
"Teams are disabled");
|
"Teams are disabled");
|
||||||
|
|
|
@ -1816,7 +1816,7 @@ void CCharacter::HandleTiles(int Index)
|
||||||
|
|
||||||
m_StartTime -= (min * 60 + sec) * Server()->TickSpeed();
|
m_StartTime -= (min * 60 + sec) * Server()->TickSpeed();
|
||||||
|
|
||||||
if((g_Config.m_SvTeam == 3 || Team != TEAM_FLOCK) && Team != TEAM_SUPER)
|
if((g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO || Team != TEAM_FLOCK) && Team != TEAM_SUPER)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||||
{
|
{
|
||||||
|
@ -1842,7 +1842,7 @@ void CCharacter::HandleTiles(int Index)
|
||||||
if(m_StartTime > Server()->Tick())
|
if(m_StartTime > Server()->Tick())
|
||||||
m_StartTime = Server()->Tick();
|
m_StartTime = Server()->Tick();
|
||||||
|
|
||||||
if((g_Config.m_SvTeam == 3 || Team != TEAM_FLOCK) && Team != TEAM_SUPER)
|
if((g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO || Team != TEAM_FLOCK) && Team != TEAM_SUPER)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||||
{
|
{
|
||||||
|
@ -2082,7 +2082,7 @@ void CCharacter::DDRaceTick()
|
||||||
HandleTuneLayer(); // need this before coretick
|
HandleTuneLayer(); // need this before coretick
|
||||||
|
|
||||||
// look for save position for rescue feature
|
// look for save position for rescue feature
|
||||||
if(g_Config.m_SvRescue || ((g_Config.m_SvTeam == 3 || Team() > TEAM_FLOCK) && Team() >= TEAM_FLOCK && Team() < TEAM_SUPER))
|
if(g_Config.m_SvRescue || ((g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO || Team() > TEAM_FLOCK) && Team() >= TEAM_FLOCK && Team() < TEAM_SUPER))
|
||||||
{
|
{
|
||||||
int Index = GameServer()->Collision()->GetPureMapIndex(m_Pos);
|
int Index = GameServer()->Collision()->GetPureMapIndex(m_Pos);
|
||||||
const int aTiles[] = {
|
const int aTiles[] = {
|
||||||
|
@ -2319,7 +2319,7 @@ void CCharacter::DDRaceInit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(g_Config.m_SvTeam == 2 && Team == TEAM_FLOCK)
|
if(g_Config.m_SvTeam == SV_TEAM_MANDATORY && Team == TEAM_FLOCK)
|
||||||
{
|
{
|
||||||
GameServer()->SendStartWarning(GetPlayer()->GetCID(), "Please join a team before you start");
|
GameServer()->SendStartWarning(GetPlayer()->GetCID(), "Please join a team before you start");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3192,7 +3192,7 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
|
||||||
g_Config.m_SvOldTeleportHook = 0;
|
g_Config.m_SvOldTeleportHook = 0;
|
||||||
g_Config.m_SvOldTeleportWeapons = 0;
|
g_Config.m_SvOldTeleportWeapons = 0;
|
||||||
g_Config.m_SvTeleportHoldHook = 0;
|
g_Config.m_SvTeleportHoldHook = 0;
|
||||||
g_Config.m_SvTeam = 1;
|
g_Config.m_SvTeam = SV_TEAM_ALLOWED;
|
||||||
g_Config.m_SvShowOthersDefault = 0;
|
g_Config.m_SvShowOthersDefault = 0;
|
||||||
|
|
||||||
if(Collision()->m_NumSwitchers > 0)
|
if(Collision()->m_NumSwitchers > 0)
|
||||||
|
@ -3208,7 +3208,7 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
|
||||||
|
|
||||||
if(g_Config.m_SvSoloServer)
|
if(g_Config.m_SvSoloServer)
|
||||||
{
|
{
|
||||||
g_Config.m_SvTeam = 3;
|
g_Config.m_SvTeam = SV_TEAM_FORCED_SOLO;
|
||||||
g_Config.m_SvShowOthersDefault = 1;
|
g_Config.m_SvShowOthersDefault = 1;
|
||||||
|
|
||||||
Tuning()->Set("player_collision", 0);
|
Tuning()->Set("player_collision", 0);
|
||||||
|
|
|
@ -70,13 +70,13 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
|
||||||
pChr->Die(ClientID, WEAPON_WORLD);
|
pChr->Die(ClientID, WEAPON_WORLD);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(g_Config.m_SvTeam == 2 && (Team == TEAM_FLOCK || m_Teams.Count(Team) <= 1))
|
if(g_Config.m_SvTeam == SV_TEAM_MANDATORY && (Team == TEAM_FLOCK || m_Teams.Count(Team) <= 1))
|
||||||
{
|
{
|
||||||
GameServer()->SendStartWarning(ClientID, "You have to be in a team with other tees to start");
|
GameServer()->SendStartWarning(ClientID, "You have to be in a team with other tees to start");
|
||||||
pChr->Die(ClientID, WEAPON_WORLD);
|
pChr->Die(ClientID, WEAPON_WORLD);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(g_Config.m_SvTeam != 3 && Team > TEAM_FLOCK && Team < TEAM_SUPER && m_Teams.Count(Team) < g_Config.m_SvMinTeamSize)
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && Team > TEAM_FLOCK && Team < TEAM_SUPER && m_Teams.Count(Team) < g_Config.m_SvMinTeamSize)
|
||||||
{
|
{
|
||||||
char aBuf[128];
|
char aBuf[128];
|
||||||
str_format(aBuf, sizeof(aBuf), "Your team has fewer than %d players, so your team rank won't count", g_Config.m_SvMinTeamSize);
|
str_format(aBuf, sizeof(aBuf), "Your team has fewer than %d players, so your team rank won't count", g_Config.m_SvMinTeamSize);
|
||||||
|
@ -149,7 +149,7 @@ void CGameControllerDDRace::OnPlayerDisconnect(CPlayer *pPlayer, const char *pRe
|
||||||
if(!GameServer()->PlayerModerating() && WasModerator)
|
if(!GameServer()->PlayerModerating() && WasModerator)
|
||||||
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, "Server kick/spec votes are no longer actively moderated.");
|
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, "Server kick/spec votes are no longer actively moderated.");
|
||||||
|
|
||||||
if(g_Config.m_SvTeam != 3)
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO)
|
||||||
m_Teams.SetForceCharacterTeam(ClientID, TEAM_FLOCK);
|
m_Teams.SetForceCharacterTeam(ClientID, TEAM_FLOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ void CGameControllerDDRace::DoTeamChange(class CPlayer *pPlayer, int Team, bool
|
||||||
|
|
||||||
if(Team == TEAM_SPECTATORS)
|
if(Team == TEAM_SPECTATORS)
|
||||||
{
|
{
|
||||||
if(g_Config.m_SvTeam != 3 && pCharacter)
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && pCharacter)
|
||||||
{
|
{
|
||||||
// Joining spectators should not kill a locked team, but should still
|
// Joining spectators should not kill a locked team, but should still
|
||||||
// check if the team finished by you leaving it.
|
// check if the team finished by you leaving it.
|
||||||
|
|
|
@ -702,7 +702,7 @@ void CPlayer::TryRespawn()
|
||||||
m_pCharacter->Spawn(this, SpawnPos);
|
m_pCharacter->Spawn(this, SpawnPos);
|
||||||
GameServer()->CreatePlayerSpawn(SpawnPos, GameServer()->m_pController->GetMaskForPlayerWorldEvent(m_ClientID));
|
GameServer()->CreatePlayerSpawn(SpawnPos, GameServer()->m_pController->GetMaskForPlayerWorldEvent(m_ClientID));
|
||||||
|
|
||||||
if(g_Config.m_SvTeam == 3)
|
if(g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
m_pCharacter->SetSolo(true);
|
m_pCharacter->SetSolo(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -430,7 +430,7 @@ CSaveTeam::~CSaveTeam()
|
||||||
|
|
||||||
int CSaveTeam::Save(int Team)
|
int CSaveTeam::Save(int Team)
|
||||||
{
|
{
|
||||||
if(g_Config.m_SvTeam == 3 || (Team > 0 && Team < MAX_CLIENTS))
|
if(g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO || (Team > 0 && Team < MAX_CLIENTS))
|
||||||
{
|
{
|
||||||
CGameTeams *Teams = &(((CGameControllerDDRace *)m_pController)->m_Teams);
|
CGameTeams *Teams = &(((CGameControllerDDRace *)m_pController)->m_Teams);
|
||||||
|
|
||||||
|
|
|
@ -309,7 +309,7 @@ void CScore::LoadTeam(const char *Code, int ClientID)
|
||||||
int Team = pController->m_Teams.m_Core.Team(ClientID);
|
int Team = pController->m_Teams.m_Core.Team(ClientID);
|
||||||
if(pController->m_Teams.GetSaving(Team))
|
if(pController->m_Teams.GetSaving(Team))
|
||||||
return;
|
return;
|
||||||
if(Team < TEAM_FLOCK || Team >= MAX_CLIENTS || (g_Config.m_SvTeam != 3 && Team == TEAM_FLOCK))
|
if(Team < TEAM_FLOCK || Team >= MAX_CLIENTS || (g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && Team == TEAM_FLOCK))
|
||||||
{
|
{
|
||||||
GameServer()->SendChatTarget(ClientID, "You have to be in a team (from 1-63)");
|
GameServer()->SendChatTarget(ClientID, "You have to be in a team (from 1-63)");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -76,11 +76,11 @@ void CGameTeams::OnCharacterStart(int ClientID)
|
||||||
CCharacter *pStartingChar = Character(ClientID);
|
CCharacter *pStartingChar = Character(ClientID);
|
||||||
if(!pStartingChar)
|
if(!pStartingChar)
|
||||||
return;
|
return;
|
||||||
if(g_Config.m_SvTeam == 3 && pStartingChar->m_DDRaceState == DDRACE_STARTED)
|
if(g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO && pStartingChar->m_DDRaceState == DDRACE_STARTED)
|
||||||
return;
|
return;
|
||||||
if((g_Config.m_SvTeam == 3 || m_Core.Team(ClientID) != TEAM_FLOCK) && pStartingChar->m_DDRaceState == DDRACE_FINISHED)
|
if((g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO || m_Core.Team(ClientID) != TEAM_FLOCK) && pStartingChar->m_DDRaceState == DDRACE_FINISHED)
|
||||||
return;
|
return;
|
||||||
if(g_Config.m_SvTeam != 3 &&
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO &&
|
||||||
(m_Core.Team(ClientID) == TEAM_FLOCK || m_Core.Team(ClientID) == TEAM_SUPER))
|
(m_Core.Team(ClientID) == TEAM_FLOCK || m_Core.Team(ClientID) == TEAM_SUPER))
|
||||||
{
|
{
|
||||||
m_TeeStarted[ClientID] = true;
|
m_TeeStarted[ClientID] = true;
|
||||||
|
@ -171,7 +171,7 @@ void CGameTeams::OnCharacterStart(int ClientID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(g_Config.m_SvTeam < 3 && g_Config.m_SvMaxTeamSize != 2 && g_Config.m_SvPauseable)
|
if(g_Config.m_SvTeam < SV_TEAM_FORCED_SOLO && g_Config.m_SvMaxTeamSize != 2 && g_Config.m_SvPauseable)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_CLIENTS; ++i)
|
for(int i = 0; i < MAX_CLIENTS; ++i)
|
||||||
{
|
{
|
||||||
|
@ -187,7 +187,7 @@ void CGameTeams::OnCharacterStart(int ClientID)
|
||||||
|
|
||||||
void CGameTeams::OnCharacterFinish(int ClientID)
|
void CGameTeams::OnCharacterFinish(int ClientID)
|
||||||
{
|
{
|
||||||
if((m_Core.Team(ClientID) == TEAM_FLOCK && g_Config.m_SvTeam != 3) || m_Core.Team(ClientID) == TEAM_SUPER)
|
if((m_Core.Team(ClientID) == TEAM_FLOCK && g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO) || m_Core.Team(ClientID) == TEAM_SUPER)
|
||||||
{
|
{
|
||||||
CPlayer *pPlayer = GetPlayer(ClientID);
|
CPlayer *pPlayer = GetPlayer(ClientID);
|
||||||
if(pPlayer && pPlayer->IsPlaying())
|
if(pPlayer && pPlayer->IsPlaying())
|
||||||
|
@ -391,7 +391,7 @@ void CGameTeams::SetForceCharacterTeam(int ClientID, int Team)
|
||||||
m_TeeFinished[ClientID] = false;
|
m_TeeFinished[ClientID] = false;
|
||||||
int OldTeam = m_Core.Team(ClientID);
|
int OldTeam = m_Core.Team(ClientID);
|
||||||
|
|
||||||
if(Team != OldTeam && (OldTeam != TEAM_FLOCK || g_Config.m_SvTeam == 3) && OldTeam != TEAM_SUPER && m_TeamState[OldTeam] != TEAMSTATE_EMPTY)
|
if(Team != OldTeam && (OldTeam != TEAM_FLOCK || g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO) && OldTeam != TEAM_SUPER && m_TeamState[OldTeam] != TEAMSTATE_EMPTY)
|
||||||
{
|
{
|
||||||
bool NoElseInOldTeam = Count(OldTeam) <= 1;
|
bool NoElseInOldTeam = Count(OldTeam) <= 1;
|
||||||
if(NoElseInOldTeam)
|
if(NoElseInOldTeam)
|
||||||
|
@ -553,7 +553,7 @@ int64_t CGameTeams::TeamMask(int Team, int ExceptID, int Asker)
|
||||||
|
|
||||||
void CGameTeams::SendTeamsState(int ClientID)
|
void CGameTeams::SendTeamsState(int ClientID)
|
||||||
{
|
{
|
||||||
if(g_Config.m_SvTeam == 3)
|
if(g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!m_pGameContext->m_apPlayers[ClientID])
|
if(!m_pGameContext->m_apPlayers[ClientID])
|
||||||
|
@ -647,7 +647,7 @@ void CGameTeams::OnTeamFinish(CPlayer **Players, unsigned int Size, float Time,
|
||||||
{
|
{
|
||||||
PlayerCIDs[i] = Players[i]->GetCID();
|
PlayerCIDs[i] = Players[i]->GetCID();
|
||||||
|
|
||||||
if(g_Config.m_SvRejoinTeam0 && g_Config.m_SvTeam != 3 && (m_Core.Team(Players[i]->GetCID()) >= TEAM_SUPER || !m_TeamLocked[m_Core.Team(Players[i]->GetCID())]))
|
if(g_Config.m_SvRejoinTeam0 && g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && (m_Core.Team(Players[i]->GetCID()) >= TEAM_SUPER || !m_TeamLocked[m_Core.Team(Players[i]->GetCID())]))
|
||||||
{
|
{
|
||||||
SetForceCharacterTeam(Players[i]->GetCID(), TEAM_FLOCK);
|
SetForceCharacterTeam(Players[i]->GetCID(), TEAM_FLOCK);
|
||||||
char aBuf[512];
|
char aBuf[512];
|
||||||
|
@ -989,7 +989,7 @@ void CGameTeams::OnCharacterSpawn(int ClientID)
|
||||||
|
|
||||||
if(m_Core.Team(ClientID) >= TEAM_SUPER || !m_TeamLocked[Team])
|
if(m_Core.Team(ClientID) >= TEAM_SUPER || !m_TeamLocked[Team])
|
||||||
{
|
{
|
||||||
if(g_Config.m_SvTeam != 3)
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO)
|
||||||
SetForceCharacterTeam(ClientID, TEAM_FLOCK);
|
SetForceCharacterTeam(ClientID, TEAM_FLOCK);
|
||||||
else
|
else
|
||||||
SetForceCharacterTeam(ClientID, ClientID); // initialize team
|
SetForceCharacterTeam(ClientID, ClientID); // initialize team
|
||||||
|
@ -1006,7 +1006,7 @@ void CGameTeams::OnCharacterDeath(int ClientID, int Weapon)
|
||||||
return;
|
return;
|
||||||
bool Locked = TeamLocked(Team) && Weapon != WEAPON_GAME;
|
bool Locked = TeamLocked(Team) && Weapon != WEAPON_GAME;
|
||||||
|
|
||||||
if(g_Config.m_SvTeam == 3 && Team != TEAM_SUPER)
|
if(g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO && Team != TEAM_SUPER)
|
||||||
{
|
{
|
||||||
ChangeTeamState(Team, CGameTeams::TEAMSTATE_OPEN);
|
ChangeTeamState(Team, CGameTeams::TEAMSTATE_OPEN);
|
||||||
ResetRoundState(Team);
|
ResetRoundState(Team);
|
||||||
|
@ -1077,7 +1077,7 @@ void CGameTeams::KillSavedTeam(int ClientID, int Team)
|
||||||
|
|
||||||
void CGameTeams::ResetSavedTeam(int ClientID, int Team)
|
void CGameTeams::ResetSavedTeam(int ClientID, int Team)
|
||||||
{
|
{
|
||||||
if(g_Config.m_SvTeam == 3)
|
if(g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
{
|
{
|
||||||
ChangeTeamState(Team, CGameTeams::TEAMSTATE_OPEN);
|
ChangeTeamState(Team, CGameTeams::TEAMSTATE_OPEN);
|
||||||
ResetRoundState(Team);
|
ResetRoundState(Team);
|
||||||
|
|
|
@ -177,7 +177,7 @@ public:
|
||||||
{
|
{
|
||||||
if(TeamID < TEAM_FLOCK || TeamID >= TEAM_SUPER)
|
if(TeamID < TEAM_FLOCK || TeamID >= TEAM_SUPER)
|
||||||
return false;
|
return false;
|
||||||
if(g_Config.m_SvTeam != 3 && TeamID == TEAM_FLOCK)
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && TeamID == TEAM_FLOCK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return m_pSaveTeamResult[TeamID] != nullptr;
|
return m_pSaveTeamResult[TeamID] != nullptr;
|
||||||
|
@ -187,7 +187,7 @@ public:
|
||||||
{
|
{
|
||||||
if(Team < TEAM_FLOCK || Team >= TEAM_SUPER)
|
if(Team < TEAM_FLOCK || Team >= TEAM_SUPER)
|
||||||
return;
|
return;
|
||||||
if(g_Config.m_SvTeam != 3 && Team == TEAM_FLOCK)
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && Team == TEAM_FLOCK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_Practice[Team] = true;
|
m_Practice[Team] = true;
|
||||||
|
@ -197,7 +197,7 @@ public:
|
||||||
{
|
{
|
||||||
if(Team < TEAM_FLOCK || Team >= TEAM_SUPER)
|
if(Team < TEAM_FLOCK || Team >= TEAM_SUPER)
|
||||||
return false;
|
return false;
|
||||||
if(g_Config.m_SvTeam != 3 && Team == TEAM_FLOCK)
|
if(g_Config.m_SvTeam != SV_TEAM_FORCED_SOLO && Team == TEAM_FLOCK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return m_Practice[Team];
|
return m_Practice[Team];
|
||||||
|
|
|
@ -46,7 +46,7 @@ void CTeamsCore::Reset()
|
||||||
|
|
||||||
for(int i = 0; i < MAX_CLIENTS; ++i)
|
for(int i = 0; i < MAX_CLIENTS; ++i)
|
||||||
{
|
{
|
||||||
if(g_Config.m_SvTeam == 3)
|
if(g_Config.m_SvTeam == SV_TEAM_FORCED_SOLO)
|
||||||
m_Team[i] = i;
|
m_Team[i] = i;
|
||||||
else
|
else
|
||||||
m_Team[i] = TEAM_FLOCK;
|
m_Team[i] = TEAM_FLOCK;
|
||||||
|
|
|
@ -12,6 +12,14 @@ enum
|
||||||
VANILLA_TEAM_SUPER = VANILLA_MAX_CLIENTS
|
VANILLA_TEAM_SUPER = VANILLA_MAX_CLIENTS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
SV_TEAM_FORBIDDEN,
|
||||||
|
SV_TEAM_ALLOWED,
|
||||||
|
SV_TEAM_MANDATORY,
|
||||||
|
SV_TEAM_FORCED_SOLO
|
||||||
|
};
|
||||||
|
|
||||||
class CTeamsCore
|
class CTeamsCore
|
||||||
{
|
{
|
||||||
int m_Team[MAX_CLIENTS];
|
int m_Team[MAX_CLIENTS];
|
||||||
|
|
Loading…
Reference in a new issue