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

Method FreeEntity

code/game/Q3_Interface.cpp:7541–7562  ·  view source on GitHub ↗

Free an Entity by ID.

Source from the content-addressed store, hash-verified

7539
7540// Free an Entity by ID.
7541void CQuake3GameInterface::FreeEntity( gentity_t *pEntity )
7542{
7543 //Make sure the entity is valid
7544 if ( pEntity->m_iIcarusID == IIcarusInterface::ICARUS_INVALID )
7545 return;
7546
7547 // Remove the Entity from the Entity map so that when their g_entity index is reused,
7548 // ICARUS doesn't try to affect the new (incorrect) pEntity.
7549 if VALIDSTRING( pEntity->script_targetname )
7550 {
7551 char temp[1024];
7552
7553 strncpy( (char *) temp, pEntity->script_targetname, 1023 );
7554 temp[ 1023 ] = 0;
7555
7556 entitylist_t::iterator it = m_EntityList.find( Q_strupr(temp) );
7557
7558 if (it != m_EntityList.end())
7559 {
7560 m_EntityList.erase(it);
7561 }
7562 }
7563
7564 // Delete the Icarus ID, but lets not construct icarus to do it
7565 if (IIcarusInterface::GetIcarus(0,false))

Callers 4

player_dieFunction · 0.80
ClientSpawnFunction · 0.80
ReadGEntitiesFunction · 0.80
G_FreeEntityFunction · 0.80

Calls 5

VALIDSTRINGFunction · 0.85
Q_struprFunction · 0.85
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected