From 027b04693f04c7a2762c7f362c8c79050315496e Mon Sep 17 00:00:00 2001 From: Fyren Date: Mon, 16 Feb 2009 16:15:11 -0500 Subject: [PATCH] Fixed ENTINDEX/INDEXENT not compiling (bug 3543, r=ds). --- game/server/util.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/game/server/util.h b/game/server/util.h index c713fbea..ee119fbb 100644 --- a/game/server/util.h +++ b/game/server/util.h @@ -141,16 +141,21 @@ public: // // Conversion among the three types of "entity", including identity-conversions. // +extern CGlobalVars *gpGlobals; inline int ENTINDEX( edict_t *pEdict) { - return engine->IndexOfEdict(pEdict); + return (int)(pEdict - gpGlobals->baseEdict); } int ENTINDEX( CBaseEntity *pEnt ); inline edict_t* INDEXENT( int iEdictNum ) { - return engine->PEntityOfEntIndex(iEdictNum); + if (iEdictNum >= 0 && iEdictNum < gpGlobals->maxEntities) + { + return (edict_t *)(gpGlobals->baseEdict + iEdictNum); + } + return NULL; } // Testing the three types of "entity" for nullity