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

[Trigger] Dose this trigger leak?

Status
Not open for further replies.
Level 2
Joined
Apr 6, 2009
Messages
10
Hi
I have made this spawntrigger for my map and it works fine. But I recently read about memory leaks that could cause ingame lag so I wounder
Dose this trigger leak?

Event
Time - Every 8.40 seconds of game time

Unit Group - Pick every unit in (Units of type Footman Factory) and do (If (((Picked unit) is alive) Equal to True) then do (Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees) else do (Do nothing))
 
Level 5
Joined
Jul 14, 2008
Messages
121
Should be like this:

  • Trigger
    • Events
      • Time - Every 8.40 seconds of game time
    • Conditions
    • Actions
      • Set Group = (Units of type Footman)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set Location = (Position of (Picked unit))
              • Unit - Create 1 Footman for (Owner of (Picked unit)) at Location facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Location)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Group)
Hope it help.
 
Status
Not open for further replies.
Top