- Joined
- May 24, 2016
- Messages
- 339
Hello, Im having a problem of trying to kill the destructables
Im out of my pc right now, but I can reproduce the way its coded.
I already used debug and found out time that unit cycle works pretty fine so as the timer itself.
Im out of my pc right now, but I can reproduce the way its coded.
JASS:
function SteamTankKillDestructable takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
// a timer every 0.1 second
call GroupClear(P) // SteamTanks destructable
set bj_groupAddGroupDest = P
call ForGroup(SteamTanksGroup,function GroupAddGroupEnumJ)
// set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(P)
exitwhen f == null
set X= GetUnitX(f)
set Y = GetUnitY(f)
call echo(GetUnitName(f))
set rct = Rect(X - 200, Y- 200, X+ 200, Y+ 200)
// call echo("destroy")
call EnumDestructablesInRect(rct, filterEnumDestructablesInCircleBJ, function SteamTankKillDestructable)
call RemoveRect(rct)
call GroupRemoveUnit(P, f)
endloop
I already used debug and found out time that unit cycle works pretty fine so as the timer itself.