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

RectContainsUnit doesn't work!

Status
Not open for further replies.
Level 1
Joined
Apr 8, 2020
Messages
5
Hi guys,
I'm encountering a big problem with triggers.
I've 2 trigger.
One of this is in GUI:
  • UnitEntersInSide
    • Events
      • Unit - A unit enters Region 042 <gen>
      • Unit - A unit enters Side Team 1 <gen>
      • Unit - A unit enters Side Team 2 <gen>
      • Unit - A unit enters Side Team 3 <gen>
      • Unit - A unit enters Side Team 4 <gen>
    • Conditions
      • ((Triggering unit) is A structure) Equal to Falso
    • Actions
      • Custom script: call Trig_DispatchUnitMove_Actions(GetTriggerUnit())
The second one is in JASS and it is:

Code:
function Trig_DispatchUnitMove_Actions takes unit unitToDispatch returns nothing
    call DisplayTextToForce( GetPlayersAll(), "HEY1" )
    if(RectContainsUnit(gg_rct_Center, unitToDispatch)) then
    call DisplayTextToForce( GetPlayersAll(), "HEY2" )
    call Trig_DispatchUnitFromCenter_Actions(unitToDispatch)
    endif
    set unitToDispatch = null
endfunction

The problem is that the if doesn't fire with gg_rct_Center. It shows "HEY1" and stop.
If I change region, it works.
My region is here:
upload_2020-4-8_11-47-37.png

I thought it was cause of regions inside the biggest and I've done them smaller. I've changed name at regions with "CenterH1" and similar, but still it doesn't fire.
Can you help me to understand why?
Thank you <3
 

Attachments

  • upload_2020-4-8_11-44-50.png
    upload_2020-4-8_11-44-50.png
    13.8 KB · Views: 24
Last edited:
Status
Not open for further replies.
Top