Permalink
Browse files

Add vehicle and object type check to CClientPed::GetContactEntity

  • Loading branch information...
codenulls committed Dec 13, 2018
1 parent a8c5bd0 commit 87e9ce0d2d914e7d4c5e5d03d731d550daeacb8d
Showing with 8 additions and 5 deletions.
  1. +8 −5 Client/mods/deathmatch/logic/CClientPed.cpp
@@ -5069,18 +5069,21 @@ bool CClientPed::IsGettingJacked(void)

CClientEntity* CClientPed::GetContactEntity(void)
{
CPools* pPools = g_pGame->GetPools();
CClientEntity* pReturn = nullptr;

CPools* pPools = g_pGame->GetPools();
if (pPools && m_pPlayerPed)
{
CEntity* pEntity = m_pPlayerPed->GetContactEntity();
if (pEntity)
{
return pPools->GetClientEntity((DWORD*)pEntity->GetInterface());
CEntitySAInterface* pInterface = pEntity->GetInterface();
eEntityType entityType = pInterface ? pEntity->GetEntityType() : ENTITY_TYPE_NOTHING;
if (entityType == ENTITY_TYPE_VEHICLE || entityType == ENTITY_TYPE_OBJECT)
{
return pPools->GetClientEntity((DWORD*)pInterface);
}
}
}
return pReturn;
return nullptr;
}

bool CClientPed::HasAkimboPointingUpwards(void)

0 comments on commit 87e9ce0

Please sign in to comment.