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

Function G_GetLocationForEnt

code/game/g_trigger.cpp:570–587  ·  view source on GitHub ↗

QUAKED trigger_location (.1 .5 .1) ? When an ent is asked for it's location, it will return this ent's "message" field if it is in it. "message" - location name NOTE: always rectangular */

Source from the content-addressed store, hash-verified

568 NOTE: always rectangular
569*/
570char *G_GetLocationForEnt( gentity_t *ent )
571{
572 vec3_t mins, maxs;
573 gentity_t *found = NULL;
574
575 VectorAdd( ent->currentOrigin, ent->mins, mins );
576 VectorAdd( ent->currentOrigin, ent->maxs, maxs );
577
578 while( (found = G_Find(found, FOFS(classname), "trigger_location")) != NULL )
579 {
580 if ( gi.EntityContact( mins, maxs, found ) )
581 {
582 return found->message;
583 }
584 }
585
586 return NULL;
587}
588
589void SP_trigger_location( gentity_t *ent )
590{

Callers 3

Q3_SetLocationFunction · 0.70
GetStringMethod · 0.70
G_CheckTasksCompletedFunction · 0.70

Calls 2

VectorAddFunction · 0.85
G_FindFunction · 0.70

Tested by

no test coverage detected