• 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.

[JASS] faster ?

Status
Not open for further replies.
Level 12
Joined
Feb 22, 2010
Messages
1,115
If you use regions which you placed via world editor use TriggerRegisterEnterRectSimple, because it is simple.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
There it is for you to see.
JASS:
function TriggerRegisterEnterRegionSimple takes trigger trig, region whichRegion returns event
    return TriggerRegisterEnterRegion(trig, whichRegion, null)
endfunction

Regions in GUI are called rects in jass.

A rect is an area that has four 90° corners. A region can consist of one or more rects.

TriggerRegisterEnterRectSimple "converts" the given rect into a region so it can be used with TriggerRegisterEnterRegion.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
TriggerRegisterEnterRectSimple leaks,
JASS:
function TriggerRegisterEnterRectSimple takes trigger trig, rect r returns event
    local region rectRegion = CreateRegion()
    call RegionAddRect(rectRegion, r)
    return TriggerRegisterEnterRegion(trig, rectRegion, null)
endfunction
the region is leaked every time you call it
 
umm i have this

JASS:
function InitTrig_Hero_Spawns_All takes nothing returns nothing
    set gg_trg_Hero_Spawns_All = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Blood_Mage )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Far_Seer )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Dreadlord )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Naga_Sea_Witch )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Beastmaster )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Firelord )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Priestess_of_the_Moon )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Warden )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Archmage )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Mountain_King )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Blademaster )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Death_Knight )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Crypt_Lord )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Illidan_evil )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Dark_Ranger )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Pit_Lord )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Demon_Hunter )
    call TriggerRegisterEnterRectSimple( gg_trg_Hero_Spawns_All, gg_rct_Nefarius_Paladin )
    call TriggerAddAction( gg_trg_Hero_Spawns_All, function Trig_Hero_Spawns_All_Actions )
endfunction

how would i make it so this doesnt leak ? using triggerregisterenterregion ? I have multiples of these so I need to know how multiples can be fixed and how to set them up
 
Last edited:
Status
Not open for further replies.
Top