P_LookForEnemies does exactly this. It will search for the closest nearby enemy and return its correspondant object userdata table. If no enemies are near the assigned player, the function returns nil.
If I had to guess, this is used for stuff like the Homing Thok ability, Fang's popgun ability, or the Attraction shield's ability.
STRUCTURE: P_LookForEnemies(player, nonenemies, bullet) ARGUMENTS: player represents the player that should search the enemies. nonenemies is a boolean (true/false). If true, the player will instead search for nearby object that are NOT enemies. bullet is a boolean (true/false). If true, the player will also search for nearby projectiles.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.