• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

EnumDestructablesInRect

Status
Not open for further replies.
Noob JASS question, can you actually select all destructibles with this function? (Because the triggers can only select up to 64 destructibles).

Code:
EnumDestructablesInRect(bj_mapInitialPlayableArea, ..., ...)

- I noticed this in Tree Revival systems, I thought maybe this will be useful in other uses.
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
can you actually select all destructibles with this function?
Yes. I've never had any problems regarding maximum number of destructibles that can be iterate over by it.
(Because the triggers can only select up to 64 destructibles).
That's just a limitation coded by Blizzard themselves.
  • Destructible - A destructible within Rect <gen> dies
JASS:
// Max events registered by a single "dest dies in region" event.
constant integer   bj_MAX_DEST_IN_REGION_EVENTS     = 64

function TriggerRegisterDestDeathInRegionEvent takes trigger trig, rect r returns nothing
    set bj_destInRegionDiesTrig = trig
    set bj_destInRegionDiesCount = 0
    call EnumDestructablesInRect(r, null, function RegisterDestDeathInRegionEnum)
endfunction

function RegisterDestDeathInRegionEnum takes nothing returns nothing
    set bj_destInRegionDiesCount = bj_destInRegionDiesCount + 1
    if (bj_destInRegionDiesCount <= bj_MAX_DEST_IN_REGION_EVENTS) then
        call TriggerRegisterDeathEvent(bj_destInRegionDiesTrig, GetEnumDestructable())
    endif
endfunction
I'm guessing they didn't want users spamming a single trigger with 30k+ registered destructibles.
 
Status
Not open for further replies.
Top