MCPcopy Create free account
hub / github.com/ddnet/ddnet / FindEntities

Method FindEntities

src/game/server/gameworld.cpp:59–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59int CGameWorld::FindEntities(vec2 Pos, float Radius, CEntity **ppEnts, int Max, int Type)
60{
61 if(Type < 0 || Type >= NUM_ENTTYPES)
62 return 0;
63
64 int Num = 0;
65 for(CEntity *pEnt = m_apFirstEntityTypes[Type]; pEnt; pEnt = pEnt->m_pNextTypeEntity)
66 {
67 if(distance(pEnt->m_Pos, Pos) < Radius + pEnt->m_ProximityRadius)
68 {
69 if(ppEnts)
70 ppEnts[Num] = pEnt;
71 Num++;
72 if(Num == Max)
73 break;
74 }
75 }
76
77 return Num;
78}
79
80void CGameWorld::InsertEntity(CEntity *pEnt)
81{

Callers 9

EvaluateSpawnTypeMethod · 0.45
CreateExplosionMethod · 0.45
TickMethod · 0.45
FireMethod · 0.45
HandleNinjaMethod · 0.45
FireWeaponMethod · 0.45
TrySetRescueMethod · 0.45
TickMethod · 0.45
LookForPlayersToDragMethod · 0.45

Calls 1

distanceFunction · 0.85

Tested by

no test coverage detected