- Joined
- Dec 29, 2009
- Messages
- 928
I had a question regarding location leaks and when they should be removed.
If, for example, you set a variable 'tempLoc' to the center of a region several times within something like a loop, would you need to remove the leak individually each time you set it, or after the loop?
For example, this is one of the triggers I use for my hero selection system.
If, for example, you set a variable 'tempLoc' to the center of a region several times within something like a loop, would you need to remove the leak individually each time you set it, or after the loop?
For example, this is one of the triggers I use for my hero selection system.
-
HS Generation
-

Events
-

Conditions
-

Actions
-


For each (Integer tempInt) from 1 to 36, do (Actions)
-



Loop - Actions
-




Set tempLoc = (Center of HS_region[tempInt])
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






HS_heroType[tempInt] Not equal to No unit-type
-
-





Then - Actions
-






Unit - Create 1 HS_heroType[tempInt] for Neutral Passive at tempLoc facing 0.00 degrees
-
-





Else - Actions
-






Unit - Create 1 devUnit for Neutral Passive at tempLoc facing 0.00 degrees
-






Set HS_heroTaken[tempInt] = True
-
-
-




Set tempLoc = (Center of HS_region[0])
-




Set HS_hero[tempInt] = (Last created unit)
-




Unit - Make HS_hero[tempInt] face tempLoc over 0.00 seconds
-




Unit - Turn collision for HS_hero[tempInt] Off
-
-
-


Custom script: call RemoveLocation(udg_tempLoc)
-
-


