FindCampmateUnits
not ratedThis function could also be called "FindContiguousUnits" or something like that, basically, starting from one unit, it finds all that units "mates", units owned by the same player, and less than threshold distance from another in the camp. This is designed for a roll-your-own creepcamp sytem.
As a test I made a string of 512 units across the map, when run the function caused only a very slight amount of lag and accurately determined that all 512 units were in the same camp.
It basically works much like a floodfill algorithm using a stack - it is not recursive.
Details:
It does NOT detect hidden units, in fact it exploits the fact that hidden units are not detected by "EnumUnitsInRange". The boolean parameter determines if it should unhide the units when done (true = yes, unhide, false = leave them hidden). For my own personal use I need the units to remain hidden; justifying the parameter.
As a test I made a string of 512 units across the map, when run the function caused only a very slight amount of lag and accurately determined that all 512 units were in the same camp.
It basically works much like a floodfill algorithm using a stack - it is not recursive.
Details:
It does NOT detect hidden units, in fact it exploits the fact that hidden units are not detected by "EnumUnitsInRange". The boolean parameter determines if it should unhide the units when done (true = yes, unhide, false = leave them hidden). For my own personal use I need the units to remain hidden; justifying the parameter.