1883: Fix crashbug on set_team_ddr -1 r=Learath2 a=fokkonaut

Teams over 63 are also forbidden, so I check for that too.

Co-authored-by: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
This commit is contained in:
bors[bot] 2019-08-05 16:37:32 +00:00
commit b0f1164485

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 < TEAM_FLOCK || Team >= TEAM_SUPER)
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);