when one unit is die , but the unit variable no set null
then next loop , if the unit variable set null , perhaps it will block the harass job, while the units behind u may still survive, but they cannot Recycle Position
solution still requires a hash table storage unit -- I don't write
temp fix
function UnitAliveInGroup takes group rg returns boolean
local unit u = null
local group g = null
set g = CopyGroup(rg, g)
loop
set u = FirstOfGroup(g)
exitwhen u == null
if not UnitAlive(u) then
call GroupRemoveUnit(rg, u)
call GroupRemoveUnit(unit_harassing, u)
endif
call GroupRemoveUnit(g, u)
endloop
call DestroyGroup(g)
set g = null
if FirstOfGroup(rg) == null then
call DestroyGroup(rg)
return false
endif
return true
endfunction
and when if town_threatened and (not state_attacking or hero_harass) then , should need RecycleHarrassPosition
windwalk_group have same bug
when unit die , the variable set null , ResetWindWalkerGuardPosition maybe cannot remove the unit from windwalk_group
when use windwalk_group , then will have bug
check UnitAliveInGroup code
when one unit is die , but the unit variable no set null then next loop , if the unit variable set null , perhaps it will block the harass job, while the units behind u may still survive, but they cannot Recycle Position
solution still requires a hash table storage unit -- I don't write
and when
if town_threatened and (not state_attacking or hero_harass) then
, should need RecycleHarrassPosition