Okay, I found the case where it was still not resetting the timer, and my inclination was right, it was when the target moved out of range. You can ignore the previous diff and apply this one (I originally didn't want to touch the Cast functions because of a rather ominous warning, but I have to now!)
Code:
Index: AA.cpp
===================================================================
--- AA.cpp (revision 2207)
+++ AA.cpp (working copy)
@@ -241,6 +241,7 @@
case aaTargetCurrentGroup:
if(GetTarget() == NULL) {
Message_StringID(MT_DefaultText, AA_NO_TARGET); //You must first select a target for this ability!
+ p_timers.Clear(&database, AATimerID + pTimerAAStart);
return;
}
target_id = GetTarget()->GetID();
@@ -501,6 +502,7 @@
case aaTargetCurrentGroup:
if(GetTarget() == NULL) {
Message_StringID(MT_DefaultText, AA_NO_TARGET); //You must first select a target for this ability!
+ p_timers.Clear(&database, timer_id + pTimerAAEffectStart);
return;
}
target_id = GetTarget()->GetID();
Index: spells.cpp
===================================================================
--- spells.cpp (revision 2207)
+++ spells.cpp (working copy)
@@ -711,6 +711,9 @@
CastToNPC()->AI_Event_SpellCastFinished(false, casting_spell_slot);
}
+ if(casting_spell_type == 1 && IsClient()) //Rest AA Timer on failed cast
+ CastToClient()->GetPTimers().Clear(&database, casting_spell_timer);
+
ZeroCastingVars(); // resets all the state keeping stuff
mlog(SPELLS__CASTING, "Spell %d has been interrupted.", spellid);