//----------------------------------------------------------------------------- // Returns an index from the given Pointer instance. //----------------------------------------------------------------------------- bool IndexFromPointer( CPointer *pEntityPointer, unsigned int& output ) { if (!IsValidNetworkedEntityPointer(pEntityPointer)) return false; return IndexFromBaseEntity((CBaseEntity *) pEntityPointer->m_ulAddr, output); }
void CSourcePython::OnEntityCreated( CBaseEntity *pEntity ) { int iIndex = IndexFromBaseEntity(pEntity); edict_t *pEdict = EdictFromIndex(iIndex); if (pEdict) { IServerUnknown* pServerUnknown = pEdict->GetUnknown(); if (pServerUnknown) pEdict->m_pNetworkable = pServerUnknown->GetNetworkable(); } CALL_LISTENERS(OnEntityCreated, iIndex, ptr((CBaseEntityWrapper*) pEntity)); }
void CSourcePython::OnEntityDeleted( CBaseEntity *pEntity ) { CALL_LISTENERS(OnEntityDeleted, IndexFromBaseEntity(pEntity), ptr((CBaseEntityWrapper*) pEntity)); }