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

Method GetByName

code/game/Q3_Interface.cpp:11224–11249  ·  view source on GitHub ↗

Polls the engine for the sequencer of the entity matching the name passed

Source from the content-addressed store, hash-verified

11222
11223//Polls the engine for the sequencer of the entity matching the name passed
11224int CQuake3GameInterface::GetByName( const char *name )
11225{
11226 gentity_t *ent;
11227 entitylist_t::iterator ei;
11228 char temp[1024];
11229
11230 if ( name == NULL || name[0] == '\0' )
11231 return -1;
11232
11233 strncpy( (char *) temp, name, sizeof(temp) );
11234 temp[sizeof(temp)-1] = 0;
11235
11236 ei = m_EntityList.find( Q_strupr( (char *) temp ) );
11237
11238 if ( ei == m_EntityList.end() )
11239 return -1;
11240
11241 ent = &g_entities[(*ei).second];
11242
11243 return ent->s.number;
11244
11245 // this now returns the ent instead of the sequencer -- dmv 06/27/01
11246// if (ent == NULL)
11247// return NULL;
11248// return ent->sequencer;
11249}
11250
11251// (g_entities[m_ownerID].svFlags&SVF_ICARUS_FREEZE)
11252// return -1 indicates invalid

Callers 2

ParseAffectMethod · 0.80
CheckAffectMethod · 0.80

Calls 3

Q_struprFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected