Function QueuedTriggerRemoveByIndex

Line
1004
Location
blizzard.j
Constant?
no
Type
function
Arguments
integer trigIndex
Returns
boolean
1004
function QueuedTriggerRemoveByIndex takes integer trigIndex returns boolean
1005
    local integer index
1006
1007
    // If the to-be-removed index is out of range, fail.
1008
    if (trigIndex >= bj_queuedExecTotal) then
1009
        return false
1010
    endif
1011
1012
    // Shift all queue entries down to fill in the gap.
1013
    set bj_queuedExecTotal = bj_queuedExecTotal - 1
1014
    set index = trigIndex
1015
    loop
1016
        exitwhen index >= bj_queuedExecTotal
1017
        set bj_queuedExecTriggers[index] = bj_queuedExecTriggers[index + 1]
1018
        set bj_queuedExecUseConds[index] = bj_queuedExecUseConds[index + 1]
1019
        set index = index + 1
1020
    endloop
1021
    return true
1022
endfunction