BlockThingsIterator

From ZDoom Wiki
Jump to: navigation, search
Note: This feature is for ZScript only.


BlockThingsIterator is a type of iterator used to search for entities that are capable of blocking. This excludes all actors with the NOBLOCKMAP flag. While there are fewer actors to search through, this iterator generates a lot of overhead which may slow down the game, while ThinkerIterator can also cause lag from searching through every single existing thinker. Caution against over-use is advised.

Members

The following are members of the iterator. These must be accessed by using a . (period) between the iterator's name and the member.

Type Variables Use
Actor thing The actor the iterator is currently checking.
Vector3 position The map coordinates of thing.
int portalflags (Verification needed)

Functions

Return Type Function Arguments (first to last) Use/Arguments
BlockThingsIterator Create
  1. Actor origin,
  2. double checkradius = -1,
  3. bool ignorerestricted = false

Initializes the iterator upon a pointer. Either this or CreateFromPos can be used.

  • origin - A pointer to an actor to perform the search upon. To perform it on the calling actor, self can be used.
  • checkradius - The radius to search. Default is -1, interpreted as "use the pointer's radius".
  • ignorerestricted - (Verification needed)

Note: this function is static and should be called off the class name, i.e. BlockThingsIterator.Create(...).

BlockThingsIterator CreateFromPos
  1. double checkx,
  2. double checky,
  3. double checkz,
  4. double checkh,
  5. double checkradius,
  6. bool ignorerestricted

Initializes the iterator upon a vector. Either this or Create can be used.

  • check-x/y/z - The coordinates for the search to perform.
  • checkradius - The radius to search. Default is -1, interpreted as "use the pointer's radius".
  • ignorerestricted - (Verification needed)

Note: this function is static and should be called off the class name, i.e. BlockThingsIterator.CreateFromPos(...).

Thinker Next None Cycles through the list of actors that are not in possession of the NOBLOCKMAP flag.
void Reinit None Restarts the search.

See Also