HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Leak question

08-21-2005, 12:14 AM#1
Spathis
Do leaks ever occur in the conditions of a trigger? For example:

Events
A unit starts the effect of an ability

Conditions
((Region centered at (Position of (Triggering unit)) with size (300, 300)) contains (Target point of ability being cast)) Equal to True

Aren't those underlined sections leaks?
08-21-2005, 04:38 AM#2
EdwardSwolenToe
Yes, that will leak, although i think only Position of unit will leak, as i dont think that target point of ability leaks.
08-21-2005, 09:25 AM#3
Anitarf
According to my knowledge, both locations and the region will leak. They are all handle objects that will be created by those functions, and never removed.
08-21-2005, 07:29 PM#4
Spathis
How would you remove those leaks?
08-21-2005, 10:36 PM#5
Anitarf
Move the condition into the actions of the trigger by using an if-then-else action. Then dispose of the leaks using the standard procedure.
08-21-2005, 11:19 PM#6
Vexorian
Couldn't you just check the distance between position of triggering unit and target point of ability being cast instead of creating a rect everytime (Still you have to remove the points)
08-22-2005, 04:55 PM#7
Spathis
Quote:
Originally Posted by Anitarf
Move the condition into the actions of the trigger by using an if-then-else action. Then dispose of the leaks using the standard procedure.

If that's the only way to remove leaks in conditions, so be it. But won't the game lag more if it has to for conditions in the actions, instead of the conditions? Example:

Trigger 1:

Events: A unit starts the effect of an ability

Conditions: Ability being cast equal to Storm Bolt

Actions: Kill target unit of ability being cast
----------
Trigger 2:

Events: A unit starts the effect of an ability

Conditions: none

Actions: If ability being cast equal to Storm Bolt then
kill target unit of ability being cast
else

Isn't trigger 1 more processor-intensive than trigger 2? Or is there no difference?