level 11
米沿甘º
楼主
写了这样一个函数
function charge takes unit u,real x2,real y2,real s returns nothing
local timer t = null
local integer tid = null
set t = CreateTimer()
set tid = GetHandleId(t)
call TimerStart(t,1,true,function TC1)
call SaveUnitHandle(ht,tid,StringHash("主角"),u)
call SaveReal(ht,tid,StringHash("终点X"),x2)
call SaveReal(ht,tid,StringHash("终点Y"),y2)
call SaveReal(ht,tid,StringHash("速度"),s)
set t = null
set u = null
endfunction
想问下此例中最后set u =null 有必要吗?
2019年12月27日 20点12分
1
function charge takes unit u,real x2,real y2,real s returns nothing
local timer t = null
local integer tid = null
set t = CreateTimer()
set tid = GetHandleId(t)
call TimerStart(t,1,true,function TC1)
call SaveUnitHandle(ht,tid,StringHash("主角"),u)
call SaveReal(ht,tid,StringHash("终点X"),x2)
call SaveReal(ht,tid,StringHash("终点Y"),y2)
call SaveReal(ht,tid,StringHash("速度"),s)
set t = null
set u = null
endfunction
想问下此例中最后set u =null 有必要吗?