Fix crash by nullptr

This commit is contained in:
Kyle
2021-02-12 01:20:25 +08:00
committed by GitHub
parent d49db221d8
commit 0fa5a52caf
+2 -2
View File
@@ -128,7 +128,7 @@ void TransmitManager::Hook_SetTransmit(CCheckTransmitInfo* pInfo, bool bAlways)
RETURN_META(MRES_IGNORED);
}
if (IsEntityIndexInRange(owner) && !g_Hooked[owner]->CanSee(client))
if (IsEntityIndexInRange(owner) && g_Hooked[owner] != nullptr && !g_Hooked[owner]->CanSee(client))
{
// blocked
RETURN_META(MRES_SUPERCEDE);
@@ -373,4 +373,4 @@ sp_nativeinfo_t g_Natives[] =
{"TransmitManager_SetEntityOwner", Native_SetEntityOwner},
{"TransmitManager_SetEntityState", Native_SetEntityState},
{nullptr, nullptr},
};
};