I seem to be having an issue in my map, when using the native "IssueTargetOrder". I have several triggers in my map that use it, and sometimes they work, sometimes they don't. Is there any known reasons why this happens? A trigger as simple as this has issues...
It works sometimes, the units actually cast the stormbolt. Same with many other triggers in my map, sometimes work. Perhaps theres some error elsewhere in my script.
JASS:
function GlacialSpikeCond takes nothing returns boolean
return UnitHasAbility(GetTriggerUnit(), 'A06K')
endfunction
function GlacialSpike takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit v = GetAttacker()
call IssueTargetOrder(u, "thunderbolt", v)
set u = null
set v = null
endfunction
function InitTrig_GlacialSpike takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i > 11
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_ATTACKED, null)
set i = i + 1
endloop
call TriggerAddCondition(t, Condition(function GlacialSpikeCond))
call TriggerAddAction(t, function GlacialSpike)
set t = null
endfunction
It works sometimes, the units actually cast the stormbolt. Same with many other triggers in my map, sometimes work. Perhaps theres some error elsewhere in my script.