Tom Jones
N/A
- Reaction score
- 437
It makes absolutely no difference where your null your variables, as long as you do it after your done using them.
JASS:
function...
local unit u //In reality local unit u = null
local integer i = GetRandomInt(1,5)
if i == 1 then
set u = GetTriggerUnit()
...
set u = null //When you null here, you know that the variable u contains a unit, and therefore needs to be nulled.
endif
set u = null //When you null here, you may not be sure that the variable u contains a unit, however if it doesn't your just setting the variable to null again.
endfunction