• 🏆 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!

Local Arrays

Status
Not open for further replies.

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Hi, I have a question about JASS's local array variables.

As you may already know, calling a local array creates 8192 variables or something around that.
My question is, since the array itself can't be nullified, we nullify only the variables that we use, right? The other variables won't leak, will they?

~Thanks for your time
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Sure you only null the used ones
I guess you dont know what nulling does
HINDYhat will see and say what it does I hope
I wont annoy myself for explaining
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Nulling doesnt mean destroying variable
For example we have a box and its id is 1
and there is a variable that points the box
variable points the box ? not exactly, it points the object with 1 id
when this box gets removed that variable still points object with 1 id which is no unit
When we create another box it wants to take id 1 because the object with 1 id got removed
But there is still a variable that points 1 id object
So for preventing that variable from pointing new box
new box gets id 2
if there is no variable or it points another thing new box gets id 1
higher id = lag
HIGHer id = crash
So you can make it point another permanent unit too instead of nulling

All pros will agree with me I guess
Result: Null the ones you use
 
Status
Not open for further replies.
Top