HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Script is leaking instances x-X.

01-12-2009, 03:33 AM#1
Blackroot
Bleh, I seem to have coded my effect system poorly. It's leaking effects and I can't figure out why, could someone point it out? I'm sure it's a simple issue I'm not seeing.

Expand JASS:

It never leaks the first instances, after that it seems to be fair game.
01-12-2009, 04:07 AM#2
Ammorth
set ATTACHED_SFX[i] = ATTACHED_SFX[SFX_COUNTER] change to set ATTACHED_SFX[i] = ATTACHED_SFX[SFX_COUNTER - 1]
SFX_COUNTER is always 1 more than the last index (since you set and then increment). You can also decrement and move instead of the subtraction.
01-13-2009, 02:55 AM#3
Blackroot
LOL I almost fell out of my chair laughing. What a stupid mistake that was >.<.

Thank you ammorth, it works great now :).
01-13-2009, 03:46 AM#4
Ammorth
I used to do it all the time too, so I know to look for it :P