Skip to content

Commit

Permalink
Null check pActivator
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozen-H2O committed Dec 6, 2024
1 parent d889b90 commit 3e15f50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/buttonwatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ std::map <int, bool> mapRecentEnts;
void ButtonWatch(const CEntityIOOutput* pThis, CEntityInstance* pActivator, CEntityInstance* pCaller, const CVariant* value, float flDelay)
{
if (!IsButtonWatchEnabled() || V_stricmp(pThis->m_pDesc->m_pName, "OnPressed") ||
!((CBaseEntity*)pActivator)->IsPawn() || !pCaller ||
mapRecentEnts.contains(pCaller->GetEntityIndex().Get()))
!pActivator || !((CBaseEntity*)pActivator)->IsPawn() ||
!pCaller || mapRecentEnts.contains(pCaller->GetEntityIndex().Get()))
return;

CCSPlayerController* ccsPlayer = CCSPlayerController::FromPawn(static_cast<CCSPlayerPawn*>(pActivator));
Expand Down

0 comments on commit 3e15f50

Please sign in to comment.