1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-04 00:23:25 +08:00

Fixed ENTINDEX and INDEXENT in utils.h (bug 4685, r=ds).

This commit is contained in:
Nicholas Hastings 2010-10-28 11:47:23 -07:00
parent 916da3c3a1
commit 0ab19ebe2e

View File

@ -144,7 +144,7 @@ public:
extern CGlobalVars *gpGlobals;
inline int ENTINDEX( edict_t *pEdict)
{
return (int)(pEdict - gpGlobals->baseEdict);
return (int)(pEdict - gpGlobals->pEdicts);
}
int ENTINDEX( CBaseEntity *pEnt );
@ -153,7 +153,7 @@ inline edict_t* INDEXENT( int iEdictNum )
{
if (iEdictNum >= 0 && iEdictNum < gpGlobals->maxEntities)
{
return (edict_t *)(gpGlobals->baseEdict + iEdictNum);
return (edict_t *)(gpGlobals->pEdicts + iEdictNum);
}
return NULL;
}