mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Merge pull request #1871 from sepulzera/fix-1841
Fix change_map command not always changing (close #1841)
This commit is contained in:
commit
5ec0efd424
|
@ -747,7 +747,11 @@ void IGameController::Tick()
|
|||
break;
|
||||
case IGS_END_MATCH:
|
||||
// start next match
|
||||
CycleMap();
|
||||
if(m_MatchCount >= m_GameInfo.m_MatchNum-1)
|
||||
CycleMap();
|
||||
|
||||
if(g_Config.m_SvMatchSwap)
|
||||
GameServer()->SwapTeams();
|
||||
m_MatchCount++;
|
||||
StartMatch();
|
||||
break;
|
||||
|
@ -885,7 +889,17 @@ static bool IsSeparator(char c) { return c == ';' || c == ' ' || c == ',' || c =
|
|||
void IGameController::ChangeMap(const char *pToMap)
|
||||
{
|
||||
str_copy(m_aMapWish, pToMap, sizeof(m_aMapWish));
|
||||
|
||||
m_MatchCount = m_GameInfo.m_MatchNum-1;
|
||||
if(m_GameState == IGS_WARMUP_GAME || m_GameState == IGS_WARMUP_USER)
|
||||
SetGameState(IGS_GAME_RUNNING);
|
||||
EndMatch();
|
||||
|
||||
if(m_GameState != IGS_END_MATCH)
|
||||
{
|
||||
// game could not been ended, force cycle
|
||||
CycleMap();
|
||||
}
|
||||
}
|
||||
|
||||
void IGameController::CycleMap()
|
||||
|
@ -903,13 +917,6 @@ void IGameController::CycleMap()
|
|||
if(!str_length(g_Config.m_SvMaprotation))
|
||||
return;
|
||||
|
||||
if(m_MatchCount < m_GameInfo.m_MatchNum-1)
|
||||
{
|
||||
if(g_Config.m_SvMatchSwap)
|
||||
GameServer()->SwapTeams();
|
||||
return;
|
||||
}
|
||||
|
||||
// handle maprotation
|
||||
const char *pMapRotation = g_Config.m_SvMaprotation;
|
||||
const char *pCurrentMap = g_Config.m_SvMap;
|
||||
|
|
Loading…
Reference in a new issue