- Joined
- Jul 25, 2011
- Messages
- 1,061
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.
Should I null everything like TU? Or reals and integers leak?
-
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
-
-
-
-





