HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I have memory leaks in some of my triggers, cant remove (trigger wont work)

08-29-2006, 09:21 AM#1
Fr0zenLord
Hmm I'll post this, see if anyone can see if theres anyway, I can remove a few position leak's

Code:
Runite Copy
    Events
        Time - Every 0.12 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 2 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at (Position of AAUnit[(Integer A)])) Equal to Icecrown Glacier - Rune Bricks
                        ((AAUnit[(Integer A)] is Mechanical) Equal to True) or ((AAUnit[(Integer A)] is An Ancient) Equal to True)
                    Then - Actions
                        Unit - Kill AAUnit[(Integer A)]
                        Custom script:   call RemoveLocation(udg_L_Copy_11)
                    Else - Actions




(ABOVE has the leak)
(I dont belive the bottom was does, but it works strangely)


                        For each (Integer A) from 2 to 12, do (Actions)
                            Loop - Actions
                                Set L_Copy_9 = (Position of AAUnit[(Integer A)])
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((AAUnit[(Integer A)] is Mechanical) Equal to True) or ((AAUnit[(Integer A)] is An Ancient) Equal to True)
                                        (Terrain type at L_Copy_9) Equal to Icecrown Glacier - Rough Dirt
                                    Then - Actions
                                        Unit - Kill AAUnit[(Integer A)]
                                        Custom script:   call RemoveLocation(udg_L_Copy_9)
                                    Else - Actions
                                        Do nothing
                        Do nothing

Im making Escape Maker map btw... also

I set all the escapers into AAUNIT (unit array of 12)
08-29-2006, 09:36 AM#2
aquilla
Use the [ trigger ] tag next time, looks much neater :) I combined the two events and moved the RemoveLocation call outside the if statement (so the location is removed even if conditions aren't true)
Trigger:
Runite Copy
Collapse Events
Time - Every 0.12 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 2 to 12, do (Actions)
Collapse Loop - Actions
Set L_Copy_9 = (Position of AAUnit[(Integer A)])
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((AAUnit[(Integer A)] is Mechanical) Equal to True) or ((AAUnit[(Integer A)] is An Ancient) Equal to True)
Collapse Or - Any condition is true
(Terrain type at L_Copy_9) Equal to Icecrown Glacier - Rough Dirt
(Terrain type at L_Copy_9) Equal to Icecrown Glacier - Rune Bricks
Collapse Then - Actions
Unit - Kill AAUnit[(Integer A)]
Else - Actions
Custom script: call RemoveLocation(udg_L_Copy_9)
08-29-2006, 02:10 PM#3
BlackFilter
There's a tut for memory leaks here on wc3campaigns... why don't you read it.