| 10-10-2006, 04:26 PM | #1 |
JASS:function EndTimer takes nothing returns nothing local integer i = H2I(GetExpiredTimer()) local unit u = udg_SomeUnit call PauseTimer(I2Timer(i)) call DestroyTimer(I2Timer(i)) //************************************************************************** //** This is where I have questions. //** If I pause/destroy this timer before doing the following calls, will //** the thread have a chance to end prematurely and not unpause/uninvul the unit? //** call SetUnitInvulnerable(u, false) call PauseUnit(u, false) set u = null endfunction function StartTimer takes nothing returns nothing local unit u = udg_SomeUnit call PauseUnit(u, true) call SetUnitInvulnerable(u, true) call TimerStart(CreateTimer(), 1.0, false, function EndTimer) set u = null endfunction The question is shown in comments in the above jass script. But basically, I'm asking if Pausing/Destroying timers in their callback can cause the thread to end prematurely? |
| 10-10-2006, 04:38 PM | #2 |
Have you tried debug messages to test? |
| 10-10-2006, 04:38 PM | #3 |
I doubt PauseTimer does, but the other day DestroyTimer seemed to have a chance it should be easier to just recycle timers though |
| 10-10-2006, 04:40 PM | #4 | |
Quote:
I'll run a test on it later tonight. Still though, I was destroying the timer in tons of spells before other calls in AotZ. So if this is an issue, then maybe I've located the cause for the multitude of bugs in AotZ. We'll see. |
| 10-10-2006, 05:46 PM | #5 |
ive been wondering this myself for a while what is this recycle timers of which you speak? im looking in the hydra spell, and i am trying to figure out how it works basically just looks like you only pause timers, and never destroy them unless there are 8191 still alive, then you destroy it what is the purpose of this, I just thought any timer bugs were caused by setting they're locals to null |
| 10-10-2006, 06:50 PM | #6 |
In my experience, destroying the timer is fine, even in its callback, of course I never really made any wildly complicated spells, so who knows what I am missing. @Emj - It seems the bugs are much more...robust than that. Seems handles can become corrupted in several ways. |
| 10-10-2006, 06:54 PM | #7 | |
Quote:
|
| 10-11-2006, 07:44 AM | #8 |
I guess, Within Timer/Enum/Filter/Condition's call not applicable operation which can interrupt execition flow. (ex: TriggerSleepAction, IssueOrder and other action with gameplay object) |
