GetTriggeringTrigger in Filter function?

Zeth

Member
Reaction score
3
When I do something like this

JASS:
 

    static method onExit takes nothing returns boolean
        local trigger trr=GetTriggeringTrigger()
        local thistype this=GetTriggerData(trr)
        local unit l=GetFilterUnit()
        local unit d
        if IsUnitEnemy(l,.p) and GetWidgetLife(l)>.405 and not IsUnitType(l,UNIT_TYPE_STRUCTURE) then
            set d=CreateUnit(.p,'h000',GetUnitX(l),GetUnitY(l),0.)
            call UnitAddAbility(d,'A004')
            call UnitApplyTimedLife(d,'BTLF',.lvl)
            call SetUnitAbilityLevel(d,'A004',R2I(.lvl))
            call IssueTargetOrder(d,"drunkenhaze",l)
            set d=null
            set l=null
            return false
        else
            set l=null
            return false
        endif
    endmethod
  static method create takes nothing returns thistype
        local thistype this=.allocate()
        set .reg=CreateRegion()
        set .tr=CreateTrigger()
        set .p=GetOwningPlayer(.c)
        set .sX=GetSpellTargetX()
        set .sY=GetSpellTargetY()
        set .lvl=GetUnitAbilityLevel(GetTriggerUnit(),'A003')
        set .rad=325+25*.lvl
        set .r=Rect(.sX-.rad,.sY-.rad,.sX+.rad,.sY+.rad)
        call RegionAddRect(.reg,.r)
        call SetTriggerData(.tr,this)
        call TriggerRegisterLeaveRegion(.tr,.reg,Filter(function thistype.onExit))
        return this
    endmethod


Doesn't work because the function GetTriggeringTrigger works only in those functions wich were executed by the trigger (with TriggerAddAction). But, in the filter that function doesn't work. What function can I use to get the handle ID of the trigger in the filter function??

thanks and sorry for my english
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
There is no way to do so.
In trigger filtering callback, only GetFilterUnit() returns value, other will not work.
So, you have to add the callback to condition instead.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top