fixed a crash, closes #56

This commit is contained in:
GreYFoX 2011-06-07 17:21:47 +02:00
parent 457fee998d
commit 9c4b1c9892

View file

@ -791,9 +791,10 @@ void IGameController::Snap(int SnappingClient)
//pGameInfoObj->m_TimeLimit = g_Config.m_SvTimelimit;
CCharacter *pChar;
CPlayer *pPlayer;
if ((pPlayer = GameServer()->m_apPlayers[SnappingClient]))
if((pChar = pPlayer->GetCharacter()))
pGameInfoObj->m_RoundStartTick = (pChar->m_DDRaceState == DDRACE_STARTED)?pChar->m_StartTime:Server()->Tick();
if(SnappingClient >= 0)
if((pPlayer = GameServer()->m_apPlayers[SnappingClient]))
if((pChar = pPlayer->GetCharacter()))
pGameInfoObj->m_RoundStartTick = (pChar->m_DDRaceState == DDRACE_STARTED)?pChar->m_StartTime:Server()->Tick();
pGameInfoObj->m_RoundNum = /*(str_length(g_Config.m_SvMaprotation) && g_Config.m_SvRoundsPerMap) ? g_Config.m_SvRoundsPerMap :*/ 0;
pGameInfoObj->m_RoundCurrent = m_RoundCount+1;