HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Crashy!

08-09-2006, 12:12 AM#1
Zoxc
I was just wondering why this is crashing Wc3 instantly without an error message.

Trigger:
KillOrders
Collapse Events
Unit - A unit Is issued an order targeting a point
Collapse Conditions
((Ordered unit) is Undead) Equal to True
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Ordered unit)) Equal to 0
Collapse Then - Actions
Unit - Order (Ordered unit) to Move To (Center of Player1END <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Ordered unit)) Equal to 1
Collapse Then - Actions
Unit - Order (Ordered unit) to Move To (Center of Player2END <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Ordered unit)) Equal to 2
Collapse Then - Actions
Unit - Order (Ordered unit) to Move To (Center of Player3END <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Ordered unit)) Equal to 3
Collapse Then - Actions
Unit - Order (Ordered unit) to Move To (Center of Player4END <gen>)
Else - Actions

Collapse JASS:
function Trig_KillOrders_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetOrderedUnit(), UNIT_TYPE_UNDEAD) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_KillOrders_Func001C takes nothing returns boolean
    if ( not ( GetUnitUserData(GetOrderedUnit()) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_KillOrders_Func002C takes nothing returns boolean
    if ( not ( GetUnitUserData(GetOrderedUnit()) == 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_KillOrders_Func003C takes nothing returns boolean
    if ( not ( GetUnitUserData(GetOrderedUnit()) == 2 ) ) then
        return false
    endif
    return true
endfunction

function Trig_KillOrders_Func004C takes nothing returns boolean
    if ( not ( GetUnitUserData(GetOrderedUnit()) == 3 ) ) then
        return false
    endif
    return true
endfunction

function Trig_KillOrders_Actions takes nothing returns nothing
    if ( Trig_KillOrders_Func001C() ) then
        call IssuePointOrderLocBJ( GetOrderedUnit(), "move", GetRectCenter(gg_rct_Player1END) )
    else
    endif
    if ( Trig_KillOrders_Func002C() ) then
        call IssuePointOrderLocBJ( GetOrderedUnit(), "move", GetRectCenter(gg_rct_Player2END) )
    else
    endif
    if ( Trig_KillOrders_Func003C() ) then
        call IssuePointOrderLocBJ( GetOrderedUnit(), "move", GetRectCenter(gg_rct_Player3END) )
    else
    endif
    if ( Trig_KillOrders_Func004C() ) then
        call IssuePointOrderLocBJ( GetOrderedUnit(), "move", GetRectCenter(gg_rct_Player4END) )
    else
    endif
endfunction

//===========================================================================
function InitTrig_KillOrders takes nothing returns nothing
    set gg_trg_KillOrders = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_KillOrders, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerAddCondition( gg_trg_KillOrders, Condition( function Trig_KillOrders_Conditions ) )
    call TriggerAddAction( gg_trg_KillOrders, function Trig_KillOrders_Actions )
endfunction
08-09-2006, 12:20 AM#2
PipeDream
Infinite order loop.
Enable/disable trigger when issuing order.