From 9e8f380121d6822c8e4bcfda2fec67b315b9a2a4 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 5 Oct 2004 00:45:15 +0000 Subject: [PATCH] changed is_valid_ent --- dlls/engine/entity.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/engine/entity.cpp b/dlls/engine/entity.cpp index c417dc34..cd437374 100755 --- a/dlls/engine/entity.cpp +++ b/dlls/engine/entity.cpp @@ -5,14 +5,18 @@ int is_ent_valid(int iEnt) if (iEnt < 1 || iEnt > gpGlobals->maxEntities) return 0; - if (iEnt >= 1 && iEnt <= gpGlobals->maxClients) + if (iEnt <= gpGlobals->maxClients) + { if (!MF_IsPlayerIngame(iEnt)) + { return 0; - - edict_t *pEnt = INDEXENT2(iEnt); - - if (FNullEnt(pEnt)) - return 0; + } + } else { + if (FNullEnt(INDEXENT(iEnt))) + { + return 0; + } + } return 1; }