//小知识,魔兽自带的PollowWait函数有个缺点,就是没有排泄干净
//就像是你大便之后,某处没有擦干净一样
//会不会觉得不爽呢?
//青菜萝卜各有所爱,孜然辣椒各有所长
//
//其实缺点就是一个,计时器没有清空
//解决方法呢,就是干掉它,如下
function Wait takes real duration returns nothing
local timer t
local real timeRemaining
if (duration > 0) then
set t = CreateTimer()
call TimerStart(t, duration, false, null)
loop
set timeRemaining = TimerGetRemaining(t)
exitwhen timeRemaining <= 0
if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
call TriggerSleepAction(0.1 * timeRemaining)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
call DestroyTimer(t)
endif
set t=null
endfunction
//要是问我使用方法的话...自己查阅jass教程吧....我还真不知道怎么说清楚
//完事