|
发表于 2007-2-21 23:32:21
|
显示全部楼层
注意16,17行
把有问题的那两行移到这里就行料...
[jass]
function Ewsp_LOOP takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit array tempUnit
local real array angle
local integer i = 0
local unit orderUnit=GetHandleUnit(t,"orderUnit")
local real UnitLocX = GetUnitX(orderUnit)
local real UnitLocY = GetUnitY(orderUnit)
local real tempLocX
local real tempLocY
local real radius = GetStoredReal(udg_gamecache,I2S(H2I(t)),"radius")
local real N = GetStoredReal(udg_gamecache,I2S(H2I(t)),"number")
local real S = GetStoredReal(udg_gamecache,I2S(H2I(t)),"speed")
local integer steps= GetStoredInteger(udg_gamecache,I2S(H2I(t)),"steps")
if steps>0 then
set steps=steps-1
call StoreInteger(udg_gamecache,I2S(H2I(t)),"steps",steps)
loop
exitwhen i>N
set i=i+1
set tempUnit=GetHandleUnit(t,I2S(1000+i))
set angle=GetStoredReal(udg_gamecache,I2S(H2I(t)),I2S(2000+i))
set angle=angle+S
set tempLocX = UnitLocX + radius*CosBJ(angle)
set tempLocY = UnitLocY + radius*SinBJ(angle)
call SetUnitPosition(tempUnit,tempLocX,tempLocY)
call StoreReal(udg_gamecache,I2S(H2I(t)),I2S(2000+i),angle)
set tempUnit=null
endloop
else
set i=0
loop
set i=i+1
exitwhen i>N
call RemoveUnit(GetHandleUnit(t,I2S(1000+i)))
endloop
call FlushStoredMission(udg_gamecache,I2S(H2I(t)))
call DestroyTimer(t)
endif
set orderUnit=null
endfunction
[/jass] |
|