• 🏆 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!

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: 21
Last edited:
Status
Not open for further replies.
Top