From aade44c915f5fe2a5a5124fce1cae4d1b5b32fa3 Mon Sep 17 00:00:00 2001 From: neon <> Date: Mon, 28 Oct 2019 13:08:12 +0100 Subject: [PATCH] MAX_EDICTS: 4096 -> 2048 --- Hitmarker/scripting/Hitmarker.sp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Hitmarker/scripting/Hitmarker.sp b/Hitmarker/scripting/Hitmarker.sp index 21e22ab6..809ba193 100644 --- a/Hitmarker/scripting/Hitmarker.sp +++ b/Hitmarker/scripting/Hitmarker.sp @@ -15,7 +15,7 @@ #define SPECMODE_THIRDPERSON 5 #define SPECMODE_FREELOOK 6 -#define MAX_EDICTS 4096 +#define MAX_EDICTS 2048 bool g_bHasOutputs[MAX_EDICTS]; bool g_bShowBossHitmarker[MAXPLAYERS+1]; @@ -435,10 +435,14 @@ public int MenuHandler_MainMenu(Menu menu, MenuAction action, int client, int se public void OnEntitySpawned(int Entity, const char[] sClassname) { int ent = EntRefToEntIndex(Entity); - if ((GetOutputCount(ent, "m_OnDamaged") > 0) || (GetOutputCount(ent, "m_OnHealthChanged") > 0)) - g_bHasOutputs[ent] = true; - else - g_bHasOutputs[ent] = false; + + if (0 < ent < MAX_EDICTS) + { + if ((GetOutputCount(ent, "m_OnDamaged") > 0) || (GetOutputCount(ent, "m_OnHealthChanged") > 0)) + g_bHasOutputs[ent] = true; + else + g_bHasOutputs[ent] = false; + } } //----------------------------------------------------------------------------------------------------