mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Add sv_team 3 (forced random team for you, useful for solo ddrace)
This commit is contained in:
parent
652d742d6a
commit
0b70f874dc
|
@ -176,7 +176,7 @@ MACRO_CONFIG_STR(SvRulesLine8, sv_rules_line8, 40, "", CFGFLAG_SERVER, "Rules li
|
|||
MACRO_CONFIG_STR(SvRulesLine9, sv_rules_line9, 40, "", CFGFLAG_SERVER, "Rules line 9")
|
||||
MACRO_CONFIG_STR(SvRulesLine10, sv_rules_line10, 40, "", CFGFLAG_SERVER, "Rules line 10")
|
||||
|
||||
MACRO_CONFIG_INT(SvTeam, sv_team, 1, 0, 2, CFGFLAG_SERVER, "Teams configuration (0 = off, 1 = on but optional, 2 = must play only with teams)")
|
||||
MACRO_CONFIG_INT(SvTeam, sv_team, 1, 0, 3, CFGFLAG_SERVER, "Teams configuration (0 = off, 1 = on but optional, 2 = must play only with teams, 3 = forced random team only for you)")
|
||||
MACRO_CONFIG_INT(SvTeamMaxSize, sv_max_team_size, 16, 2, 16, CFGFLAG_SERVER, "Maximum team size (from 2 to 16)")
|
||||
|
||||
MACRO_CONFIG_STR(SvAnnouncementFileName, sv_announcement_filename, 24, "announcement.txt", CFGFLAG_SERVER, "file which will have the announcement, each one at a line")
|
||||
|
|
|
@ -115,7 +115,7 @@ void CGameContext::ConSettings(IConsole::IResult *pResult, void *pUserData)
|
|||
"%s %s",
|
||||
g_Config.m_SvTeam == 1 ?
|
||||
"Teams are available on this server" :
|
||||
!g_Config.m_SvTeam ?
|
||||
(g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3) ?
|
||||
"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" : */
|
||||
"and if you die in a team only you die");
|
||||
|
@ -660,7 +660,7 @@ void CGameContext::ConJoinTeam(IConsole::IResult *pResult, void *pUserData)
|
|||
"You are running a vote please try again after the vote is done!");
|
||||
return;
|
||||
}
|
||||
else if (g_Config.m_SvTeam == 0)
|
||||
else if (g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3)
|
||||
{
|
||||
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
||||
"Admin has disabled teams");
|
||||
|
|
|
@ -411,10 +411,22 @@ void CPlayer::TryRespawn()
|
|||
if(!GameServer()->m_pController->CanSpawn(m_Team, &SpawnPos))
|
||||
return;
|
||||
|
||||
CGameControllerDDRace* Controller = (CGameControllerDDRace*)GameServer()->m_pController;
|
||||
|
||||
m_Spawning = false;
|
||||
m_pCharacter = new(m_ClientID) CCharacter(&GameServer()->m_World);
|
||||
m_pCharacter->Spawn(this, SpawnPos);
|
||||
GameServer()->CreatePlayerSpawn(SpawnPos, m_pCharacter->Teams()->TeamMask(m_pCharacter->Team(), -1, m_ClientID));
|
||||
|
||||
int NewTeam = 1;
|
||||
if(g_Config.m_SvTeam == 3)
|
||||
{
|
||||
for(; NewTeam < TEAM_SUPER; NewTeam++)
|
||||
if(Controller->m_Teams.Count(NewTeam) == 0)
|
||||
break;
|
||||
|
||||
Controller->m_Teams.SetCharacterTeam(GetCID(), NewTeam);
|
||||
}
|
||||
}
|
||||
|
||||
bool CPlayer::AfkTimer(int NewTargetX, int NewTargetY)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
enum
|
||||
{
|
||||
TEAM_FLOCK = 0, TEAM_SUPER = 16
|
||||
TEAM_FLOCK = 0, TEAM_SUPER = 17
|
||||
};
|
||||
|
||||
class CTeamsCore
|
||||
|
|
Loading…
Reference in a new issue