From 3e15f506d9c8d43878cbf0e4bfd5ddfeec39bbe8 Mon Sep 17 00:00:00 2001 From: Frozen-H2O <43626458+Frozen-H2O@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:40:58 -0800 Subject: [PATCH] Null check pActivator --- src/buttonwatch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buttonwatch.cpp b/src/buttonwatch.cpp index d50c02b3..922d16ce 100644 --- a/src/buttonwatch.cpp +++ b/src/buttonwatch.cpp @@ -97,8 +97,8 @@ std::map 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(pActivator));