Okay, I think I need your help.
Today, I was checking out how many 32 tick timers there are running on my map, because I've heard that people with a not-so-good PC have FPS issues. Since it appeared that there are 13 instances of CT32 running, I thought I'd upgrade my version, so that I can manually start/stop them.
And here's the problem: whenever I start one, and stop it, I can't seem to able to start it again.
I just tested it with an item that uses it, by adding a debug text. When I bought it, the text was constantly appearing, then I sold it and it stopped. Okay, great, that's what should happen. However, when I bought it again, the text wasn't appearing again. And it's true, not a single one of my systems work after stopping the timer. Buffs remain, Dot's/HoT's don't work, damage texts are not appearing, etcetera. I was trying to fix it, but honestly, these retarded variable "names" are giving me a headache. I know you're on good terms with Nestharus, maybe you've already came across this problem and know how to fix it. Or maybe you've already got used to reading his code. I don't know, I just hope you can help me, because staring at this spaghetti always makes me hungry after 2 minutes. If you cannot, well then... *sigh*, I'll get myself go through the code and find what's wrong.
Anyways, here's CTL:
http://www.hiveworkshop.com/forums/jass-resources-412/snippet-constant-timer-loop-32-a-201381/
And here's the my code:
http://www.hiveworkshop.com/forums/pastebin.php?id=li52cr
(It's CTL32, so that I JASSHelper would help me find all the modules that use it).
I made two changes to CTL though:
Put the start/stop methods into CT32 from CT32End;
The start/stop methods increase/decrease a global counter.
But none of these changes should be causing such an issue.
Thanks in advance!
[EDIT]
Hmm, I actually do believe that TGroup32 wouldn't allow the timer to be restarted again.
[EDIT2]
Well, nvm, I found the problem. When I have to face a bug I just can't stop till it's fixed, so I went through the code myself.
So, here's the bug:
When you call thistype.stop(), it marks the timer instance with the "recycling" flag, but not with "destroying". The periodic then recycles it, but the "recycling" flag is not removed, since it's inside the "destroying" block - so it's reset properly when marked with both flags, but not when you only stop it. I basically took it out of the if block and it seems to work. Although I'm still testing it, I just saved it, but the buffs work already, so I guess it's okay.