MCPcopy Index your code
hub / github.com/assaultcube/AC / loopv

Function loopv

source/src/world.cpp:181–190  ·  view source on GitHub ↗

find entity of closest distance in desired solid angle

Source from the content-addressed store, hash-verified

179 if(best < 0)
180 { // find entity of closest distance in desired solid angle
181 loopv(ents)
182 {
183 entity &e = ents[i];
184 if(!(enttypemask & (1 << e.type))) continue;
185 if(intersectangular(camera1->o, worldpos, vec(e.x, e.y, e.z), maxangle, dist) && dist < bdist)
186 {
187 best = i;
188 bdist = dist;
189 }
190 }
191
192 if(best >= 0)
193 { // if closest ent shares location with other ents, pick one with clentsel

Callers 2

enumentitiesFunction · 0.70
enumtodoentitiesFunction · 0.70

Calls 7

intersectangularFunction · 0.85
vecClass · 0.85
cvecprintfFunction · 0.85
formatentityattributesFunction · 0.85
deletesoundentityFunction · 0.85
scalecompFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected