From 43f5d71724121eda528aaf96e2cdd5e88f4bb2ad Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Fri, 14 Nov 2008 23:08:24 -0600 Subject: [PATCH] Fixed IndexOfEdict and PEntityOfEntIndex inlines to be in line with updated edict_t structure in SDK --- public/compat_wrappers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/compat_wrappers.h b/public/compat_wrappers.h index 242c12c6..40b6534d 100644 --- a/public/compat_wrappers.h +++ b/public/compat_wrappers.h @@ -123,13 +123,13 @@ #if SOURCE_ENGINE >= SE_LEFT4DEAD inline int IndexOfEdict(const edict_t *pEdict) { - return ((int)pEdict - (int)gpGlobals->baseEdict) >> 4; + return (int)(pEdict - gpGlobals->baseEdict); } inline edict_t *PEntityOfEntIndex(int iEntIndex) { if (iEntIndex >= 0 && iEntIndex < gpGlobals->maxEntities) { - return (edict_t *)((int)gpGlobals->baseEdict + (iEntIndex << 4)); + return (edict_t *)(gpGlobals->baseEdict + iEntIndex); } return NULL; }