HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

USE call FlushHandleLocals(u) ?

05-18-2006, 05:29 PM#1
MasterofSickness
Not that I open to many threads, but when I have a question and I can't find an answer, I can ask here or?
Just to be sure and make nothing wrong...

I have seen this function on wc3jass.com
Collapse JASS:
local unit u = // ...Some unit
call FlushHandleLocals(u) // Clean up!!
call RemoveUnit(u)

It should nullify the unit u, which was written there:
"FlushHandleLocals(handle h) will remove all local variables set on a given handle."

So instead of using
Collapse JASS:
set u=null
,
you can use
Collapse JASS:
call FlushHandleLocals(u)
?

For some reasons it is not working...
It expects a function name, which tells me,
that this FlushHandleLocals() - Command doesn't exist?
05-18-2006, 05:33 PM#2
Blade.dk
FlushHandleLocals is a custom function, and it does someting completely different.

The local handle variables is a system that uses return bug and gamecache to 'attach' stuff to the unit, useful for jass spells and systems, and so. FlushHandleLocals flushes the category in a gamecache, a category unique to the unit, to clear data. You can find the Local Handle Variables functions here.

You still need to set the variable to null.
05-18-2006, 05:46 PM#3
MasterofSickness
Wow, ok, thanks for the answer, but that's too high for me to understand

I will just use nullifying...

By the way (because of my old thread last post, where noone answered yet),
I looked up in the common.j from W3x.mpq and there is written following:
type texttag extends handle

So, texttag is a handle?
And all handles listed up there has to be setted to null If you use them?
05-18-2006, 05:56 PM#4
Captain Griffen
You don't need to understand it for the moment. Just use nullifying.

To the other questions: yes.
05-18-2006, 06:00 PM#5
MasterofSickness
Cool, thanks, I got it now!
05-18-2006, 06:06 PM#6
Anitarf
Correct, all local variables of the type handle must be set to null before the function finishes.

Don't confuse this with "local handle variables", that's a jass system with an awkwardly chosen name, which leads to a lot of confusion like this. The "local handle variables" aren't local variables of the type handle, as Blade mentioned, they are a set of functions used for storing data to gamecache under a key that is unique to a specific handle object (which can be a unit, a unit group, a location, a timer, a textag...), thus allowing to have information that is "local" to that object, like the local variables are local to their functions, hence the awkward name.