Originally Posted by SDPhantom
Looks like the behavior changed since the last time I looked at it too. This is concerning when the reset timer resets. This is found in the function that's run when the command is executed. I started digging when I didn't see anything referring to the reset timer in the event handler or any of the functions it calls.
Lua Code:
-- Reset the timeout each time the sequence is used local timeout = strmatch(entry.reset, "(%d+)"); if ( timeout ) then entry.timeout = CastSequenceManager.elapsed + tonumber(timeout); end
ChatFrame.lua:993
|
Yes. Well, I had a look at the code myself and this is what I noticed:
That snippet you quoted is in function
ExecuteCastSequence (
ChatFrame.lua:949 ).
In that function, before the snippet you posted, there is this other snippet:
Lua Code:
-- Don't do anything if this entry is still pending
if ( entry.pending ) then
return;
end
ChatFrame.lua:981
And in function
CastSequenceManager_OnEvent (
ChatFrame.lua:872 ), you have this snippet:
Lua Code:
if ( event == "UNIT_SPELLCAST_SENT" ) then
entry.pending = castID;
elseif ( entry.pending == castID ) then
entry.pending = nil;
if ( event == "UNIT_SPELLCAST_SUCCEEDED" ) then
SetNextCastSequence(sequence, entry);
end
end
ChatFrame.lua:903
So, UNIT_SPELLCAST_SENT sets
entry.pending to a non-nil value, and any one of the other watched events sets it to nil. And only UNIT_SPELLCAST_SUCCEEDED actually advances the sequence to the next entry.
So what you said earlier about UNIT_SPELLCAST_SENT is at least partially true: Calling the macro when the currently active entry is uncastable should act, as far as the timer reset is concerned, as if the macro had never been recalled, because the function exits before the timer reset snippet you posted.
However, there are other events watched, besides UNIT_SPELLCAST_SENT and UNIT_SPELLCAST_SUCCEEDED, that do clear the value of
entry.pending, without advancing the sequence's entry.
These are the events that would do that:
Lua Code:
event == "UNIT_SPELLCAST_INTERRUPTED" or
event == "UNIT_SPELLCAST_FAILED" or
event == "UNIT_SPELLCAST_FAILED_QUIET" ) then
ChatFrame.lua:885
The first two events fire when, after a successful casting-start, the cast doesn't complete. In this case, the timer would be reset, but the entry in the castsequence would remain the same.
The last event, UNIT_SPELLCAST_FAILED_QUIET, I'm unfamiliar with. But I'm thinking this may be the server's response to a UNIT_SPELLCAST_SENT of a spell that is not available to be started. And this would explain why the castsequence timer resets on that
Consecrated Flame on-CD.