2088: Fix antibot crash r=Learath2 a=heinrich5991

`m_Core.m_HookedPlayer` can be -1 if you get teleported the moment you'd
normally attach the hook.

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
bors[bot] 2020-03-16 13:19:57 +00:00 committed by GitHub
commit 477b8ff987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -772,7 +772,8 @@ void CCharacter::Tick()
if(m_Core.m_TriggeredEvents&COREEVENT_HOOK_ATTACH_PLAYER)
{
if(GameServer()->m_apPlayers[m_Core.m_HookedPlayer]->GetTeam() != -1)
if(m_Core.m_HookedPlayer != -1
&& GameServer()->m_apPlayers[m_Core.m_HookedPlayer]->GetTeam() != -1)
{
Antibot()->OnHookAttach(m_pPlayer->GetCID(), true);
}