|
如图,咱啥也没做他竟然都报我错!!
我x你民的无效变量!
贴一下:
[jass]
function bSys_Move takes nothing returns nothing
local integer id = TDS_GetTimerIndex(GetExpiredTimer())
local real x = 0.
local real dx = 0.
local real y = 0.
local real dy = 0.
local integer i = 0
local integer m = 0
local unit u = null
local group g = null
if udg_bSys_I[id] != 0 then
set udg_bSys_I[id] = udg_bSys_I[id] - 1
set i = R2I(udg_bSys_Vel[id] / 32.) + 1
set x = GetUnitX(udg_bSys_Unit[id])
set y = GetUnitY(udg_bSys_Unit[id])
set dx = 32. * Cos(GetUnitFacing(udg_bSys_Unit[id]) * bj_DEGTORAD)
set dy = 32. * Sin(GetUnitFacing(udg_bSys_Unit[id]) * bj_DEGTORAD)
set g = CreateGroup()
loop
set m = m + 1
if sPointIsInMap(x + dx, y + dy, false) == true then
set x = x + dx
set y = y + dy
call GroupEnumUnitsInRange(g, x, y, 32., udg_Sys_CommonFilter)
call GroupRemoveUnit(udg_bSys_Caster[id])
set u = FirstOfGroup(g)
if u != null then
loop
exitwhen u == null
call UnitDamageTarget(udg_bSys_Caster[id], u, udg_bSys_Damage[id], true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call GroupRemoveUnit(g, u)
set u = FirstOfGroup(g)
endloop
call SetUnitX(udg_bSys_Unit[id], x)
call SetUnitY(udg_bSys_Unit[id], y)
call TDS_Release(GetExpiredTimer())
call KillUnit(udg_bSys_Unit[id])
call DestroyGroup(g)
set udg_bSys_Unit[id] = null
set udg_bSys_Caster[id] = null
set u = null
set g = null
endif
else
call TDS_Release(GetExpiredTimer())
call KillUnit(udg_bSys_Unit[id])
call DestroyGroup(g)
set udg_bSys_Unit[id] = null
set udg_bSys_Caster[id] = null
set u = null
set g = null
endif
exitwhen m == i
endloop
set x = GetUnitX(udg_bSys_Unit[id]) + udg_bSys_Vel[id] * Cos(GetUnitFacing(udg_bSys_Unit[id]) * bj_DEGTORAD)
set y = GetUnitY(udg_bSys_Unit[id]) + udg_bSys_Vel[id] * Sin(GetUnitFacing(udg_bSys_Unit[id]) * bj_DEGTORAD)
call SetUnitX(udg_bSys_Unit[id], x)
call SetUnitY(udg_bSys_Unit[id], y)
set udg_bSys_Vel[id] = udg_bSys_Vel[id] + udg_bSys_Acc[id]
else
call TDS_Release(GetExpiredTimer())
call KillUnit(udg_bSys_Unit[id])
call DestroyGroup(g)
set udg_bSys_Unit[id] = null
set udg_bSys_Caster[id] = null
set u = null
set g = null
endif
endfunction
[/jass]
结果发现把上面那一行call GroupRemoveUnit(udg_bSys_Caster[id])删了就没事了.......我....... |
|