I saw the memory leaks tutorials and try fixing a spell of mine to understand how to do it, however i did everything that need to remove the leaks and the game still lags after some uses of the spell... help!
There are 2 triggers.
PS: I searched similar topics to Memory Leaks and i didnt find something simillar to this.
There are 2 triggers.
- Unit - A unit Starts the effect of an ability
- (Ability being cast) equal to Tsuga
- Set Casting_Units[32] = (Casting unit)
- Set Point_Tsuga = (Target point of ability being cast)
- Unit - Turn collision for Casting_Units[32] Off
- Unit - Pause Casting_Units[32]
- Trigger - Turn on Tsuga 2 <gen>
- Time - Every 0.01 seconds of game time
- No conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Casting_Units[32] is alive Equal to True
-
Then - Actions
- Set Point_Tsuga_Leak = (Position of Casting_Units[32])
- Set Point_Tsuga_Leak2 = (Point_Tsuga_Leak offset by 50.00 towards (Angle from (Position of Casting_Units[32] to Point_Tsuga) degrees)
- Unit - Move Casting_Units[32] instantly to Point_Tsuga_Leak2, facing Point_Tsuga
- Custom script: call RemoveLocation( udg_Point_Tsuga_Leak )
- Custom script: call RemoveLocation( udg_Point_Tsuga_Leak2)
- Animation - play Casting_Units[32]'s walk animation
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between (Position of Casting_Units[32]) and Point_Tsuga) Less than or equal to 50.00
-
Then - Actions
- Unit - Turn collision for Casting_Units[32] On
- Unit - Create 1 Spells Dummy for (Owner of Casting_Units[32] at Point_Tsuga facing Default building facing degrees
- Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
- Unit - Add a 1.00 second generic expiration timer to (Last created unit)
- Unit - Unpause Casting_Units[32]
- Selection - Select Casting_Units[32] for (Owner of Casting_Units[32])
- Animation - Play Casting_Units[32]'s attack animation
- Custom script call RemoveLocation( udg_Point_Tsuga )
- Trigger - Turn off (This trigger)
-
Else - Actions
- Do Nothing
-
If - Conditions
-
Else Actions
- Trigger - Turn off (This Trigger)
-
If - Conditions
PS: I searched similar topics to Memory Leaks and i didnt find something simillar to this.