diff --git a/regamedll/dlls/bot/cs_bot_vision.cpp b/regamedll/dlls/bot/cs_bot_vision.cpp index 56f75678..5e4e3026 100644 --- a/regamedll/dlls/bot/cs_bot_vision.cpp +++ b/regamedll/dlls/bot/cs_bot_vision.cpp @@ -797,7 +797,9 @@ CBasePlayer *CCSBot::FindMostDangerousThreat() float distSq = d.LengthSquared(); #ifdef REGAMEDLL_ADD - if (isSniperRifle(pPlayer->m_pActiveItem)) { + CBasePlayerWeapon *pCurrentWeapon = static_cast(pPlayer->m_pActiveItem); + if (pCurrentWeapon && isSniperRifle(pCurrentWeapon)) + { m_isEnemySniperVisible = true; if (sniperThreat) {