Warcraft III resources & community, 2003–2006 · archived

MultiboardItemMakeTemporary

not rated
Submitted by PepparVariable Change0 downloads
Similar to GroupMakeTemporary, this function releases multiboarditem m when the calling thread either finishes or sleeps.

Note that releasing a multiboarditem is not the same thing as removing it from the multiboard it is on, it just frees the memory that a multiboarditem reference takes up.

The child-functions Child1 and Child2 converts an multiboarditem to integer and vice versa. This is because there are no multiboarditem globals in blizzard.j.

Source

function MultiboardItemMakeTemporary_Child1 takes multiboarditem m returns integer
    if true then
        return m
    endif
    return 0
endfunction
function MultiboardItemMakeTemporary_Child2 takes integer i returns multiboarditem
    if true then
        return i
    endif
    return null
endfunction
function MultiboardItemMakeTemporary_Child3 takes nothing returns nothing
    local multiboarditem m = MultiboardItemMakeTemporary_Child2(bj_groupCountUnits)
    call TriggerSleepAction(0)
    call MultiboardReleaseItem(m)
    set m = null
endfunction
function MultiboardItemMakeTemporary takes multiboarditem m returns multiboarditem
    local trigger dispatcher = CreateTrigger()
    set bj_groupCountUnits = MultiboardItemMakeTemporary_Child1(m)
    call TriggerAddAction(dispatcher, function MultiboardItemMakeTemporary_Child3)
    call TriggerExecute(dispatcher)
    call DestroyTrigger(dispatcher)
    set dispatcher = null
    return m
endfunction

Comments

0

No comments.