(25-05-2011 15:12)elihos a écrit : Tout d'abord, merci pour cette réponse rapide (et un +1)
Merci !
J'ai regardé un peu cette fonction IsNonMeleeSpellCasted et le paramètre qu'elle prends (true ou false) est "withDelayed".
Par contre je ne comprends pas bien la notion de délai dans ce cas, est-ce qu'il faudrait savoir si c'est un sort avec délai ou pas ?
Essaie une fois avec true et une fois avec false pour voir ce que cela donne
Pour les personnes que ça intéresse, voici la fonction complète :
[code=cpp]
bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat) const
{
// We don't do loop here to explicitly show that melee spell is excluded.
// Maybe later some special spells will be excluded too.
// generic spells are casted when they are not finished and not delayed
if ( m_currentSpells[CURRENT_GENERIC_SPELL] &&
(m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) &&
(withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED) )
return(true);
// channeled spells may be delayed, but they are still considered casted
else if ( !skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] &&
(m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) )
return(true);
// autorepeat spells may be finished or delayed, but they are still considered casted
else if ( !skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL] )
return(true);
return(false);
}
[/code]