Warcraft III resources & community, 2003–2006 · archived

Removing a unit variable, without removing the unit?

4 posts
#1

Removing a unit variable, without removing the unit?

RemoveUnit()
Removes a unit, and the variable right?

But is there any way, to just remove the variable?
#2
If you mean a variable set using the handle variables, you just set that variable to null (or 0) and it is cleaned up.

If you mean a global or local variable, it makes no sense trying to remove them.
#3
You can't really remove variables, but by setting them to null they won't use the memory. This is only important with locals though, just do it at the end of the function.
#4
I was sleepy last night and didint realize that you didint have to remove/destroy the unit-variable before nullifying it :P. Sleepyness sucks :P.