AlicanC
New Member
- Reaction score
- 2
I have a triger called "Hero Select Orders". It's a part of my double-click-hero-selection system. It has to disable all orders issued to that unit. (I remove 'Aatk' and 'Amov', but they still can use abilities.)
I made this trigger, but when I enable this all triggers gets disabled somehow.
Where is the problem?
I made this trigger, but when I enable this all triggers gets disabled somehow.
JASS:
function Trig_Hero_Select_Orders_Actions takes nothing returns nothing
//Locals
local unit triggerUnit= GetTriggerUnit()
//Pause, order to stop and resume unit
call PauseUnit(triggerUnit, true)
call IssueImmediateOrder(triggerUnit, "stop")
call PauseUnit(triggerUnit, false)
//Nullify
set triggerUnit= null
endfunction
//===========================================================================
function InitTrig_Hero_Select_Orders takes nothing returns nothing
//Locals
local group heroes= CreateGroup()
local unit current
//Create trigger
set gg_trg_Hero_Select_Orders= CreateTrigger()
//Get units in Hero Selection
call GroupEnumUnitsInRect(heroes, gg_rct_Hero_Selection, null)
//Register events
loop
set current= FirstOfGroup(heroes)
exitwhen current==null
call TriggerRegisterUnitEvent(gg_trg_Hero_Select_Orders, current, EVENT_UNIT_ISSUED_TARGET_ORDER)
call TriggerRegisterUnitEvent(gg_trg_Hero_Select_Orders, current, EVENT_UNIT_ISSUED_POINT_ORDER)
call TriggerRegisterUnitEvent(gg_trg_Hero_Select_Orders, current, EVENT_UNIT_ISSUED_ORDER)
endloop
//Add actions
call TriggerAddAction(gg_trg_Hero_Select_Orders, function Trig_Hero_Select_Orders_Actions)
//Nullify
call DestroyGroup(heroes)
set heroes= null
endfunction
Where is the problem?