mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-01-03 16:13:22 +08:00
Fixed ENTINDEX/INDEXENT not compiling (bug 3543, r=ds).
This commit is contained in:
parent
3e5d0a7960
commit
027b04693f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user