• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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