Warcraft III resources & community, 2003–2006 · archived

ForceRemoveForce

not rated
Submitted by PepparVariable Change0 downloads
Removes all players in sourceForce from destForce, and returns a reference to destForce for easier programming.

It uses bj_FORCE_ALL_PLAYERS as a placeholder, and it shouldn't pose any problems since it is reset at the end of the function. The only problem would be if the function is interrupted due to thread timeout.

Basically a modified version of Blizzard.j function GroupRemoveGroup.

Source

function ForceRemoveForce_Enum takes nothing returns nothing
    call ForceRemovePlayer(bj_FORCE_ALL_PLAYERS, GetEnumPlayer())
endfunction
function ForceRemoveForce takes force sourceForce, force destForce returns force
    local force f = bj_FORCE_ALL_PLAYERS
    set bj_FORCE_ALL_PLAYERS = destForce
    call ForForce(sourceForce, function ForceRemoveForce_Enum)
    set bj_FORCE_ALL_PLAYERS = f
    return destForce
endfunction

Comments

0

No comments.