Crash Fixes
This commit is contained in:
parent
038da8c96f
commit
5fe65853fc
@ -52,7 +52,8 @@ bool shouldTarget(CachedEntity *entity)
|
||||
// Don't shoot players in truce
|
||||
if (isTruce())
|
||||
return false;
|
||||
return shouldTargetSteamId(entity->player_info->friendsID);
|
||||
if (entity->player_info)
|
||||
return shouldTargetSteamId(entity->player_info->friendsID);
|
||||
}
|
||||
else if (entity->m_Type() == ENTITY_BUILDING)
|
||||
// Don't shoot buildings in truce
|
||||
@ -75,7 +76,8 @@ bool shouldAlwaysRenderEsp(CachedEntity *entity)
|
||||
{
|
||||
if (entity->m_Type() == ENTITY_PLAYER)
|
||||
{
|
||||
return shouldAlwaysRenderEspSteamId(entity->player_info->friendsID);
|
||||
if (entity->player_info)
|
||||
return shouldAlwaysRenderEspSteamId(entity->player_info->friendsID);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -150,7 +152,8 @@ static CatCommand mark_betrayal("pl_mark_betrayal", "Mark a steamid32 as betraya
|
||||
|
||||
void onKilledBy(CachedEntity *entity)
|
||||
{
|
||||
onKilledBy(entity->player_info->friendsID);
|
||||
if (entity->player_info)
|
||||
onKilledBy(entity->player_info->friendsID);
|
||||
}
|
||||
|
||||
class PlayerToolsEventListener : public IGameEventListener2
|
||||
|
@ -364,8 +364,9 @@ static void cm()
|
||||
if (!isValidTarget(entity))
|
||||
continue;
|
||||
// No enemy check, since steamid is very specific
|
||||
if (steamid != entity->player_info->friendsID) // steamid check
|
||||
continue;
|
||||
if (entity->player_info)
|
||||
if (steamid != entity->player_info->friendsID) // steamid check
|
||||
continue;
|
||||
if (startFollow(entity, isNavBotCM))
|
||||
{
|
||||
navinactivity.update();
|
||||
@ -399,8 +400,9 @@ static void cm()
|
||||
continue;
|
||||
if (entity->m_bEnemy())
|
||||
continue;
|
||||
if (accountid != entity->player_info->friendsID)
|
||||
continue;
|
||||
if (entity->player_info)
|
||||
if (accountid != entity->player_info->friendsID)
|
||||
continue;
|
||||
if (startFollow(entity, isNavBotCM))
|
||||
{
|
||||
navinactivity.update();
|
||||
|
@ -160,7 +160,7 @@ bool IsDefault(unsigned steamid)
|
||||
|
||||
bool IsDefault(CachedEntity *entity)
|
||||
{
|
||||
if (entity && entity->player_info->friendsID)
|
||||
if (entity && entity->player_info && entity->player_info->friendsID)
|
||||
return IsDefault(entity->player_info->friendsID);
|
||||
return true;
|
||||
}
|
||||
@ -173,7 +173,7 @@ bool IsFriend(unsigned steamid)
|
||||
|
||||
bool IsFriend(CachedEntity *entity)
|
||||
{
|
||||
if (entity && entity->player_info->friendsID)
|
||||
if (entity && entity->player_info && entity->player_info->friendsID)
|
||||
return IsFriend(entity->player_info->friendsID);
|
||||
return false;
|
||||
}
|
||||
@ -238,7 +238,7 @@ bool ChangeState(unsigned int steamid, k_EState state, bool force)
|
||||
|
||||
bool ChangeState(CachedEntity *entity, k_EState state, bool force)
|
||||
{
|
||||
if (entity && entity->player_info->friendsID)
|
||||
if (entity && entity->player_info && entity->player_info->friendsID)
|
||||
return ChangeState(entity->player_info->friendsID, state, force);
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user