• 🏆 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] Why does this leak??

Status
Not open for further replies.
Level 14
Joined
Jul 25, 2011
Messages
1,065
I am creating a shooting system and I'm checking if it's leaking by the trigger below. My trigger is leaking... And I see nothing leaking. Please help me.
  • Temp
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Custom script: local location L = Location(0,0)
      • Custom script: call BJDebugMsg(I2S(GetHandleId(L)-0x100000))
      • Custom script: call RemoveLocation(L)
      • Custom script: set L = null
  • Shoot
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Shoot (Handgun)
        • Then - Actions
          • Set TP1 = (Position of (Triggering unit))
          • Set TP2 = (Target point of ability being cast)
          • Unit - Create 1 Dummy 2 for (Owner of (Triggering unit)) at TP1 facing ((Angle from TP1 to TP2) + (Random real number between -5.00 and 5.00)) degrees
          • Unit Group - Add (Last created unit) to WeakBullets
          • Custom script: call RemoveLocation(udg_TP1)
          • Custom script: call RemoveLocation(udg_TP2)
        • Else - Actions
  • Every 001 sec
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in WeakBullets and do (Actions)
        • Loop - Actions
          • Set TU = (Picked unit)
          • Unit - Set life of TU to ((Life of TU) - 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of TU) Greater than 80.00
            • Then - Actions
              • Set TP1 = (Position of TU)
              • Set TP2 = (TP1 offset by 50.00 towards (Facing of (Picked unit)) degrees)
              • Unit - Move TU instantly to TP2
              • Set TG = (Units within 70.00 of TP2)
              • Custom script: call RemoveLocation(udg_TP1)
              • Custom script: call RemoveLocation(udg_TP2)
              • Unit Group - Pick every unit in TG and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • ((Owner of (Picked unit)) is an ally of (Owner of TU)) Equal to True
                          • ((Triggering unit) is dead) Equal to True
                    • Then - Actions
                    • Else - Actions
                      • Unit - Cause TU to damage (Picked unit), dealing (Random real number between 10.00 and 20.00) damage of attack type Normal and damage type Normal
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\GyroCopter\GyroCopterImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\GyroCopter\GyroCopterImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\GyroCopter\GyroCopterImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Remove TU from the game
                      • Unit Group - Remove TU from WeakBullets
              • Custom script: call DestroyGroup(udg_TG)
            • Else - Actions
              • Unit - Remove TU from the game
          • Custom script: set udg_TU = null
Should I null everything like TU? Or reals and integers leak?
 
I don't see any leaks. Describe what is happening in terms of the text displayed. Is the number constantly going up? Or is it bouncing between two numbers? Or is it just a consistent number?

If it is constantly going up, then it is leaking. If it is bouncing between two numbers, then it is probably not leaking in that trigger. (that just happens due to the nature of the handle checking thing) If it is a consistent number, then that means you are probably not leaking in that trigger.
 
Status
Not open for further replies.
Top