MCPcopy Create free account
hub / github.com/JACoders/OpenJK / InitEntity

Method InitEntity

code/game/Q3_Interface.cpp:7517–7538  ·  view source on GitHub ↗

Initialize an Entity by ID.

Source from the content-addressed store, hash-verified

7515
7516// Initialize an Entity by ID.
7517bool CQuake3GameInterface::InitEntity( gentity_t *pEntity )
7518{
7519 //Make sure this is a fresh entity.
7520 assert( pEntity->m_iIcarusID == IIcarusInterface::ICARUS_INVALID );
7521
7522 if ( pEntity->m_iIcarusID != IIcarusInterface::ICARUS_INVALID )
7523 return false;
7524
7525 // Get an Icarus ID.
7526 pEntity->m_iIcarusID = IIcarusInterface::GetIcarus()->GetIcarusID( pEntity->s.number );
7527
7528 // Initialize all taskIDs to -1
7529 memset( &pEntity->taskID, -1, sizeof( pEntity->taskID ) );
7530
7531 // Add this entity to a map of valid associated entity's for quick retrieval later.
7532 AssociateEntity( pEntity );
7533
7534 //Precache all the entity's scripts.
7535 PrecacheEntity( pEntity );
7536
7537 return false;
7538}
7539
7540// Free an Entity by ID.
7541void CQuake3GameInterface::FreeEntity( gentity_t *pEntity )

Callers 6

ClientSpawnFunction · 0.80
scriptrunner_runFunction · 0.80
NPC_BeginFunction · 0.80

Calls 1

GetIcarusIDMethod · 0.80

Tested by

no test coverage detected