• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] omfg! Blizzard natives leak!!! (please say im wrong)

Status
Not open for further replies.
Level 3
Joined
Aug 4, 2004
Messages
22
well, as it turns out, after some extensive testing, i have come to the conclusion that blizzards native group api functions, namely, GroupEnumUnitsInRect, and GroupEnumUnitsInRange LEAK!.

i expect the problem, like with PolarProjectionBJ, is that the location and rect arguments are never removed in the function.

hopefully im wrong, but i doubt it.

man, is there another way to to Group Units In Range?

ive lost all faith in scripting now. :(
 
Level 6
Joined
Sep 9, 2004
Messages
152
I use one tragedic method wich you won't like so much.I use loops.Here is one pretty way to make it.
JASS:
 local group g1   
 //Choose whatever name you want
 local group g2=CreateGroup()     
 //I use another group cause in my way you'll lose all the units in g1
 local unit u
     set g1=GetUnitsInRangeOfLocAll({radius},{location{)
     loop
         exitwhen IsUnitGroupEmptyBJ(g1)==true
         //Here the loop will exitwhen you clean up the group g1
         set u=FirstOfGroup(g1)
         //actions you wish to add like "call KillUnit(GetEnumUnit())"but this time is 'u'not 'enumunit'
         //..........
         call GroupAddUnitSimple(u,g2)     
         //Here below we remove 'u' from 'g1' so we add it again in 'g2' cause you'll maybe need those units again.
         call GroupRemoveUnitSimple(u,g1)    
         //this is needed cause we need to show the first unit and as they are disapearing from 'g1' the first unit will be other
     endloop
 set u=null
 set g1=null
 set g2=null
This way you'll break down the functions added to the GetUnisInRange.Well i hope you understand it.GL
 
Level 3
Joined
Aug 4, 2004
Messages
22
lol. :)

GetUnitsInRangeOfLocAll calls GetUnitsInRangeOfLocMatching,

GetUnitsInRangeOfLocMatching calls, GroupEnumUnitsInRangeOfLoc, which leaks.
 
Status
Not open for further replies.
Top