• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] What does this command do? :P just wondering

Status
Not open for further replies.
You may also ask Why would I want to assign it to a variable?
Because if you don't do that and also don't use custom script that you showed, then you got leaks. Leaks makes your map laggy. That code is there to prevent that, simply.
 
JASS:
function ForGroupBJ takes group whichGroup, code callback returns nothing
    // If the user wants the group destroyed, remember that fact and clear
    // the flag, in case it is used again in the callback.
    local boolean wantDestroy = bj_wantDestroyGroup
    set bj_wantDestroyGroup = false

    call ForGroup(whichGroup, callback)

    // If the user wants the group destroyed, do so now.
    if (wantDestroy) then
        call DestroyGroup(whichGroup)
    endif
endfunction

When you call Pick Every Unit blah blah... you are calling the jass function of ForGroupBJ

So, what this function does is actually checking the boolean variable of bj_wantDestroyGroup first. If it's true, which means you want to destroy the group, it simply destroys the group after his job is done with them.

By the way, when you call Pick Every Unit function, you set bj_wantDestroyGroup to false again. So you need to set bj_wantDestroyGroup to true everytime before you use Pick Every Unit blah blah function. :)
 
Status
Not open for further replies.
Back
Top