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

Function CG_SetEntitySoundPosition

codeJK2/cgame/cg_ents.cpp:120–136  ·  view source on GitHub ↗

====================== CG_SetEntitySoundPosition Also called by event processing code ====================== */

Source from the content-addressed store, hash-verified

118======================
119*/
120vec3_t *CG_SetEntitySoundPosition( centity_t *cent ) {
121 static vec3_t v3Return;
122 if ( cent->currentState.solid == SOLID_BMODEL ) {
123 vec3_t origin;
124 float *v;
125
126 v = cgs.inlineModelMidpoints[ cent->currentState.modelindex ];
127 VectorAdd( cent->lerpOrigin, v, origin );
128 cgi_S_UpdateEntityPosition( cent->currentState.number, origin );
129 VectorCopy(origin, v3Return);
130 } else {
131 cgi_S_UpdateEntityPosition( cent->currentState.number, cent->lerpOrigin );
132 VectorCopy(cent->lerpOrigin, v3Return);
133 }
134
135 return &v3Return;
136}
137
138/*
139==================

Callers 2

CG_EntityEffectsFunction · 0.70
CG_CheckEventsFunction · 0.70

Calls 3

VectorAddFunction · 0.85
VectorCopyFunction · 0.85

Tested by

no test coverage detected