Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

findradius

From Quake Wiki

entity findradius(vector pos, float range)

Usage[edit]

Grabs all entities within range of the passed position. This compares against the center of the entities and not their origins. Entities with the solid type SOLID_NONE are ignored.

Warning: This function uses the chain field to create a linked list of entities that it found. Nested calls should be avoided as only one linked list can be guaranteed active at a time and the base working list can become corrupted.

Parameters[edit]

  • pos
The position in the map to test from.
  • range
The max distance the center of an entity can be from the position.

Return[edit]

The head of the linked list of found entities. Their chain field will point to the next entity in the list.

Example[edit]

// Find all entities within 256 map units of the caller's origin
// Loop through them performing a task
for (entity it = findradius(self.origin, 256); it; it = it.chain)
    PerformTask(it);