HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

EnumUnitsCounter

01-10-2010, 09:30 PM#1
Timl fe
Hi,
Functions like GroupEnumUnitsInRadiusCounted or GroupEnumUnitsInRectCounted seem not to work correctly: whatever integer I pass as countLimit they always enumerate all units in rect/radius. It seems it's a bug. Have any info about it?
01-11-2010, 02:02 AM#2
Joker
Elaborate more please. Post a code.
01-11-2010, 12:43 PM#3
Timl fe
Collapse JASS:
call GroupEnumUnitsInRadiusCounted(myGroup, 0, 0, 512, null, 3)
So enumerate units in 512 radius of 0, 0 point, no filter (null), countLimit - 3. This will add do myGroup all units in that radius, not only 3 (as stated by countLimit).
01-11-2010, 04:37 PM#4
DioD
Counted function DONT WORK
01-11-2010, 04:47 PM#5
Troll-Brain
It's basically the same as GroupEnumUnitsInRadius, with an extra useless argument countLimit, the value of it doesn't matter.
You have to use a global variable integer, increase it inside the boolexpr when the unit perform your check, and when the integer reach your value, always return false.

Wait ...
since when we have a native GroupEnumUnitsInRadius function, you mean GroupEnumUnitsInRange ?
Or is it a custom one ?
01-11-2010, 09:19 PM#6
Timl fe
Nah, I mean't radius, it's mistake. Right. Ty for answers :)