CCSBot::FindMostDangerousThreat: Fix crash when m_pActiveItem is null Related #1055

This commit is contained in:
s1lentq 2025-04-08 06:31:12 +07:00
parent 797c265db3
commit 5bf71bdb18

View File

@ -797,7 +797,9 @@ CBasePlayer *CCSBot::FindMostDangerousThreat()
float distSq = d.LengthSquared();
#ifdef REGAMEDLL_ADD
if (isSniperRifle(pPlayer->m_pActiveItem)) {
CBasePlayerWeapon *pCurrentWeapon = static_cast<CBasePlayerWeapon *>(pPlayer->m_pActiveItem);
if (pCurrentWeapon && isSniperRifle(pCurrentWeapon))
{
m_isEnemySniperVisible = true;
if (sniperThreat)
{