• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Fixing a leak

Status
Not open for further replies.
Level 14
Joined
Oct 16, 2010
Messages
749
Hi All,

I've been thinking of how to fix a leak (potentially multiple leaks) but wasn't sure about it.

Basically the situation is that I have numerous abilities that cause enemies to explode on death, damaging other nearby enemies. However here's where the leak would occur as:

- Enemy 1 dies
- Set location of enemy 1
- Pick unit group around enemy 1
- Damage picked enemies
- IF ANY UNIT DIES -> trigger will run again

The problem here is that obviously if the trigger is run again it won't clear the first location and unit group.

Anyway my thought was just to add a short wait before the on-kill effect, would that work?
 
Level 13
Joined
Jan 2, 2016
Messages
978
You can use local variables...
  • Custom script: local location p = GetUnitLoc(GetTriggerUnit())
  • Custom script: set udg_TempPoint = p
  • ------------ Pick the units in range and do what you want -------------
  • Custom script: call RemoveLocation(p)
 
Status
Not open for further replies.
Top