|
实在找不到什么地方能释放的了,马甲单位我都释放过了,也没创建点。但是技能一放就会卡,我很郁闷所以大家有空帮我看一下到底是哪里有泄露。
[jass]function Scatter takes nothing returns nothing
local timer T = GetExpiredTimer()
local unit u = i2u(GetStoredInteger(udg_GG,"散射",I2S(h2i(T))))
local unit array mj
local unit mb
local real r
local real x
local real y
local integer i=1
local integer index = GetStoredInteger(udg_GG,"Scatter",I2S(h2i(T)))
local group g = CreateGroup()
if index < 50 then
loop
exitwhen i > 7
set mj = i2u(GetStoredInteger(udg_GG,"散射",(I2S(h2i(T))+I2S(i))))
set r = GetUnitFacing(mj)
set x = GetUnitX(mj)+20*CosBJ(r)
set y = GetUnitY(mj)+20*SinBJ(r)
if IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) == false then
if IsUnitAliveBJ(mj) == true then
call SetUnitX(mj,x)
call SetUnitY(mj,y)
call GroupEnumUnitsInRange(g,GetUnitX(mj),GetUnitY(mj),250,null)
loop
set mb = FirstOfGroup(g)
exitwhen mb==null
call GroupRemoveUnit(g,mb)
if ( (IsUnitAliveBJ(mb) == true) and (IsUnitEnemy(mb, GetOwningPlayer(mj)) == true and IsUnitInGroup(mb, udg_temp[1]) == false ) ) then
call UnitDamageTarget( u, mb, ( ( 200.00 + ( I2R(GetUnitAbilityLevelSwapped('A00A', u)) * 75.00 ) ) + ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, u, true)) * 0.80 ) ), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
call RemoveUnit(mj)
call FlushStoredInteger(udg_GG, "散射",(I2S(h2i(T))+I2S(i)))
call GroupAddUnitSimple( mb, udg_temp[1] )
set mj = null
set mb = null
endif
endloop
call DestroyGroup( g )
else
call FlushStoredInteger(udg_GG, "散射",(I2S(h2i(T))+I2S(i)))
endif
else
call ExplodeUnitBJ( mj )
endif
set i = i + 1
endloop
set index = index + 1
call StoreInteger(udg_GG,"Scatter",I2S(h2i(T)),index)
else
loop
exitwhen i > 7
set mj = i2u(GetStoredInteger(udg_GG,"散射",(I2S(h2i(T))+I2S(i))))
call ExplodeUnitBJ(mj)
call FlushStoredInteger(udg_GG, "散射",(I2S(h2i(T))+I2S(i)))
set mj = null
set i = i + 1
endloop
call FlushStoredInteger(udg_GG,"散射",I2S(h2i(T)))
call DestroyTimer(T)
call GroupClear( udg_temp[1] )
set u = null
set mb = null
endif
set u = null
set mb = null
set mj = null
endfunction
[/jass] |
|