• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Solved] Turn off trigger, do something, turn on trigger. Is this a safe method to avoid infinite loops?

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 67
Joined
Aug 10, 2018
Messages
6,953
So, my trigger is working fine. I'm just curious if turning off a trigger, then doing something that would run the trigger's Events, then turning the trigger back on is a safe method to avoid a crash/infinite loop.

  • Destructible Death
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Occlusion height of (Picked destructible)) Greater than 0.00
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Destructible - Remove (Picked destructible)
          • Trigger - Turn on (This trigger)
        • Else - Actions
      • Else - Actions
In my trigger's case, removing the picked destructible causes the trigger to run again, thus it tries to remove itself over and over again and crashes the game. However, turning the trigger on and off like I did prevents that problem. Is this a safe practice?
 
Status
Not open for further replies.
Top