Expelliarmus
Where to change the sig?
- Reaction score
- 48
This is part of my whole trigger that currently doesn't work. the others aren't not called, so it won't matter.
Problem: Dummy gets removed in bolded line, which stops the whole timer...
Ar is struct array, Temp_Unit and FoG are globals
Thanks
Problem: Dummy gets removed in bolded line, which stops the whole timer...
Ar is struct array, Temp_Unit and FoG are globals
JASS:
function handlerFunc takes nothing returns nothing
local Data d = Ar[1]
local integer i = Total
local real x
local real y
local real angle
local group dummy = d.dummy
set Temp_Unit = d.caster
loop
set FoG = FirstOfGroup(dummy)
exitwhen FoG == null
<b>call GroupRemoveUnit(dummy, FoG)</b> // removes unit from d.dummy as well??
// movement
set angle = Atan2(GetUnitY(FoG) - GetUnitY(Temp_Unit), GetUnitX(FoG)- GetUnitX(Temp_Unit)) + Increment * bj_DEGTORAD
call BJDebugMsg(I2S(CountUnitsInGroup(dummy))) // 2,1, 0
call BJDebugMsg(I2S(CountUnitsInGroup(d.dummy)))
set x = GetUnitX(d.caster) + Distance * Cos(angle )
set y = GetUnitY(d.caster) + Distance * Sin(angle )
call SetUnitPosition(FoG, x, y)
endloop
set FoG = null
set Temp_Unit = null
call DestroyGroup(dummy)
set dummy = null
Thanks