Fix crashbug on set_team_ddr -1

This commit is contained in:
fokkonaut 2019-08-04 23:38:08 +02:00
parent d35550ce19
commit ac588f324c

View file

@ -661,6 +661,9 @@ void CGameContext::ConSetDDRTeam(IConsole::IResult *pResult, void *pUserData)
int Target = pResult->GetVictim();
int Team = pResult->GetInteger(1);
if (Team < 0 || Team >= MAX_CLIENTS)
return;
if(pController->m_Teams.m_Core.Team(Target) && pController->m_Teams.GetDDRaceState(pSelf->m_apPlayers[Target]) == DDRACE_STARTED)
pSelf->m_apPlayers[Target]->KillCharacter(WEAPON_SELF);