Jump to content

Fixed [Stealth Check for Casting Target]


NoHad
 Share

Recommended Posts

Fixed [stealth Check for Casting Target]: If someone were casting spell and target get into a stealth it was sucessfuly casted, and the same with vanish there is fix:

diff -r aacaf6e3d037d5321445c87c6c5b5e3c1d138c40 -r 9d057e753a04874c7e3c767faea94f89210cf853 src/game/Spell.cpp

--- a/src/game/Spell.cpp Mon Dec 12 14:39:44 2011 +0100

+++ b/src/game/Spell.cpp Mon Dec 12 14:43:29 2011 +0100

@@ -2421,6 +2421,15 @@

void Spell::cast(bool skipCheck)

{

+

+ if (Unit *pTarget = m_targets.getUnitTarget())

+ if (pTarget->isAlive() && (pTarget->HasAuraType(SPELL_AURA_MOD_STEALTH) || pTarget->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)) && !pTarget->IsFriendlyTo(m_caster) && !pTarget->isVisibleForOrDetect(m_caster, m_caster, true))

+ {

+ SendCastResult(SPELL_FAILED_BAD_TARGETS);

+ finish(false);

+ return;

+ }

+

SetExecutedCurrently(true);

if (!m_caster->CheckAndIncreaseCastCounter())

Enjoy :)

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use