Skip to content

Commit

Permalink
[10730] Check if Pet's target is a valid target (isTargetableForAttack)
Browse files Browse the repository at this point in the history
Signed-off-by: NoFantasy <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed Nov 17, 2010
1 parent dd8c847 commit cdb7a64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/game/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5383,6 +5383,9 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
if(!_target->isAlive())
return SPELL_FAILED_BAD_TARGETS;

if (!_target->isTargetableForAttack())
return SPELL_FAILED_BAD_TARGETS; // guessed error

if(IsPositiveSpell(m_spellInfo->Id))
{
if(m_caster->IsHostileTo(_target))
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10729"
#define REVISION_NR "10730"
#endif // __REVISION_NR_H__

2 comments on commit cdb7a64

@LordJZ
Copy link
Contributor

@LordJZ LordJZ commented on cdb7a64 Nov 17, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(!_target->isAlive()) is checked in if (!_target->isTargetableForAttack()) so you should remove the prev.check

@NoFantasy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, thanks for notice :D

Please sign in to comment.