• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help Me

Status
Not open for further replies.
Level 13
Joined
Jan 2, 2016
Messages
978
Using wrong words for example makes it not understandable.
By using my imagination, I guess you may want to say:
"what is better , to loop trough unit arrays or trough unit groups"... (I can't guess what are you trying to say in the next sentence) about leak I would wanted to make sure that the motion timer cycle not leak.
Don't know if you really mean that or something completely different tho.

Anyways.. if that's what you mean - both have pros and cons. In most cases I stick to unit groups, UNLESS I need to count the units in the group 1-st and then do actions. In that case - during the loop I remove the units from the group (since I'm using FoG method), and save them in a unit array, then I just loop the array, and clear it at the same time.
However, if you aren't using FoG method, then stick to unit groups :p
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Neither periodic timers or periodic triggers leak by themselves. Using unit groups also does not leak as long as the unit group object and its handle is managed correctly. Issuing units orders individually or in a group both do not leak.

Issue the units individually if you detect them individually. If you are dealing with groups then issue them as a group.
 
Status
Not open for further replies.
Top