function Trig_Remove_Defend_Conditions takes nothing returns boolean
if ( GetIssuedOrderId() == String2OrderIdBJ("defend") ) then
return true
endif
return false
endfunction
function Trig_Remove_Defend_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
call TriggerSleepAction( 1.00 )
call IssueImmediateOrder( u, "undefend" )
set u = null
endfunction
function InitTrig_Remove_Defend takes nothing returns nothing
set gg_trg_Remove_Defend = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Remove_Defend, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Remove_Defend, Condition( function Trig_Remove_Defend_Conditions ) )
call TriggerAddAction( gg_trg_Remove_Defend, function Trig_Remove_Defend_Actions )
endfunction