Steel
Software Engineer
- Reaction score
- 109
JASS:
call TimerStart(caller,redo,true,function BurningSteps) // We start timer that will run every "redo" time and will call BurningSteps function.
call TriggerSleepAction(Wait) // We wait "Wait" time which was defined earilier.
call FlushHandleLocals(caller) // We destroy the linkage between caster and timer
call DestroyTimer(caller)
This bit of code is well...bad. It's a very common thing among new JASSers. You shouldn't need to have to call a wait after a timer, its completely unnecessary especially in this situation. Just a minor note, TriggerSleepAction is the most inaccurate way to track time. Timer > Polled Wait > Sleep Action.
Anyway to the point, you should have a destructor (Yes this is JASS, but its the same thing) inside your timer that will clean up the trigger for you when you are finished using it, you shouldn't have to create a wait.
Hope that helps.