Warcraft III resources & community, 2003–2006 · archived

ForceAddForce

not rated
Submitted by PepparVariable Change0 downloads
Adds all players in sourceForce to 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 GroupAddGroup.

Source

function ForceAddForce_Enum takes nothing returns nothing
    call ForceAddPlayer(bj_FORCE_ALL_PLAYERS, GetEnumPlayer())
endfunction
function ForceAddForce takes force sourceForce, force destForce returns force
    local force f = bj_FORCE_ALL_PLAYERS
    set bj_FORCE_ALL_PLAYERS = destForce
    call ForForce(sourceForce, function ForceAddForce_Enum)
    set bj_FORCE_ALL_PLAYERS = f
    return destForce
endfunction

Comments

0

No comments.