Free an Entity by ID.
| 7539 | |
| 7540 | // Free an Entity by ID. |
| 7541 | void 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)) |
no test coverage detected