A Problem with DisableTrigger

cleeezzz

The Undead Ranger.
Reaction score
268
JASS:
   call DisableTrigger(LazorTrig)
    loop
        set fog = FirstOfGroup(g)
        exitwhen fog == null
        call UnitDamageTarget(d.tower,fog,d.damage,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,null)
        set d.damage = d.damage * .75
        call GroupRemoveUnit(g,fog)
    endloop
    call EnableTrigger(LazorTrig)


those are the actions, and these are the events,

JASS:
private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger(  )
    set LazorTrig = trig
    call TriggerRegisterAnyUnitDamaged(trig)
    call TriggerAddAction( trig, function Actions )
endfunction


yet it still infinite loops O_O
 

quraji

zap
Reaction score
144
Try commenting out the EnableTrigger() call to see if that changes anything. I'm not sure really what my logic behind that is...but it doesn't hurt to try. Also, add a healthy amount of DebugMessages to track what its doing.
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56

cleeezzz

The Undead Ranger.
Reaction score
268
tried the boolean as well, it still pases o_O, (note that this function is a callback function of the Main Actions)

edit: even commenting out the enable doesn't do anything O_OOOO
 

quraji

zap
Reaction score
144
Are you sure it's an infinite loop problem (or if it is, that it's caused by that)?
 

cleeezzz

The Undead Ranger.
Reaction score
268
oh wait, my custom event

JASS:
private function Call takes nothing returns boolean
    local integer i = COUNT - 1
    loop
        if TriggerEvaluate(TRIGS<i>) then
            call TriggerExecute(TRIGS<i>)
        endif
        set i = i - 1
        exitwhen i &lt; 0
    endloop
    return false
endfunction</i></i>


that probably calls the trigger no matter if its disabled or not.. how do i add a check to see if trigger is disabled?
 

FlashDeath

New Member
Reaction score
2
just to point out something, in your init function, u can just set Lazortrig = CreateTrigger(), don't need to assign it to local var then to Lazortrig. Even if you want to assign it to local var, I suggest you set trig= null at the end to avoid leak.
 
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