• 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] Rect or Region?

Status
Not open for further replies.
Level 5
Joined
Sep 19, 2006
Messages
152
In the following, is it necessary to do the whole "set r =" thing, or is the second trigger more efficient? I'm not really sure how the whole rect/region thing works?

JASS:
function InitTrig_CaveEntrance takes nothing returns nothing
    local region r = CreateRegion ()
//
    set gg_trg_CaveEntrance = CreateTrigger ()
    call RegionAddRect (r, gg_rct_Cave)
    call TriggerRegisterEnterRegion (gg_trg_CaveEntrance, r, null)
    set r = null
    call TriggerAddCondition (gg_trg_CaveEntrance, Condition (function CaveEntrance_Condition01))
    call TriggerAddAction (gg_trg_CaveEntrance, function CaveEntrance_Action01)
endfunction

or

JASS:
function InitTrig_CaveEntrance takes nothing returns nothing
    set gg_trg_CaveEntrance = CreateTrigger ()
    call TriggerRegisterEnterRegion (gg_trg_CaveEntrance, gg_rct_Cave, null)
    call TriggerAddCondition (gg_trg_CaveEntrance, Condition (function CaveEntrance_Condition01))
    call TriggerAddAction (gg_trg_CaveEntrance, function CaveEntrance_Action01)
endfunction
 
Status
Not open for further replies.
Top