Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/game/server/gamecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,7 @@ void IGameController::StartMatch()
m_aTeamscore[TEAM_RED] = 0;
m_aTeamscore[TEAM_BLUE] = 0;

// start countdown if there're enough players, otherwise do warmup till there're
if(HasEnoughPlayers())
SetGameState(IGS_START_COUNTDOWN);
else
SetGameState(IGS_WARMUP_GAME, TIMER_INFINITE);
OnRoundStart();

Server()->DemoRecorder_HandleAutoStart();
char aBuf[256];
Expand All @@ -652,6 +648,11 @@ void IGameController::StartRound()

++m_RoundCount;

OnRoundStart();
}

void IGameController::OnRoundStart()
{
// start countdown if there're enough players, otherwise abort to warmup
if(HasEnoughPlayers())
SetGameState(IGS_START_COUNTDOWN);
Expand Down
6 changes: 6 additions & 0 deletions src/game/server/gamecontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ class IGameController
*/
virtual bool OnEntity(int Index, vec2 Pos);

/*
Function: OnRoundStart
Called when a new match or round starts.
*/
virtual void OnRoundStart();

virtual void OnPlayerConnect(class CPlayer *pPlayer);
virtual void OnPlayerDisconnect(class CPlayer *pPlayer);
virtual void OnPlayerInfoChange(class CPlayer *pPlayer);
Expand Down
Loading