Warcraft III resources & community, 2003–2006 · archived

ForceMakeTemporary

not rated
Submitted by PepparVariable Change0 downloads
Similar to GroupMakeTemporary, this function destroys the force after the calling thread has finished, or when the calling thread sleeps.

Source

function ForceMakeTemporary_Child takes nothing returns nothing
    local force f = bj_FORCE_ALL_PLAYERS
    call TriggerSleepAction(0)
    call DestroyForce(f)
    set f = null
endfunction

function ForceMakeTemporary takes force f returns force
    local force t = bj_FORCE_ALL_PLAYERS
    local trigger dispatcher = CreateTrigger()
    set bj_FORCE_ALL_PLAYERS = f
    call TriggerAddAction(dispatcher, function ForceMakeTemporary_Child)
    call TriggerExecute(dispatcher)
    call DestroyTrigger(dispatcher)
    set bj_FORCE_ALL_PLAYERS = t
    set dispatcher = null
    return f
endfunction

Comments

0

No comments.