• 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.

clearing array

Status
Not open for further replies.
Level 10
Joined
Apr 13, 2005
Messages
630
Can you give me an example of the trigger because I'm confused a little

*edit* i feel stupid well anyway things that usually leak are
Location leaks
Special Effect leaks
Lightning leaks
Unit Group leaks
Player Group leaks

I dont believe a unit variable would leak unless it has a location in it
 
Level 7
Joined
Jul 20, 2008
Messages
377
it does

u clear it like this (found out myself)

set udg_Dummy[bj_forLoopAIndex] = null

i spelled for big For before so it didnt work ;)

Yes. You would do this:

JASS:
local integer a
local integer b=(insert array size here)
loop
exitwhen a==b
set your_array[a]=null
set a=a+1
endloop

Of course, replacing pieces of this code when needed.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Oh, then just run a loop from 0 to the last slot in your array and set everything to null.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Wait, wait, when you say you wanted to clear an unit array, do you mean remove all the units in your array from the game?
 
Status
Not open for further replies.
Top