Skip to content

Commit

Permalink
[8717] Fixed SPELL_EFFECT_TAMECREATURE broken after [8686]
Browse files Browse the repository at this point in the history
Signed-off-by: ApoC <apoc@nymfe.net>
  • Loading branch information
apoc committed Oct 23, 2009
1 parent 044c6df commit fcef298
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/game/Spell.cpp
Expand Up @@ -4318,12 +4318,15 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_EFFECT_TAMECREATURE:
{
if (m_caster->GetTypeId() != TYPEID_PLAYER ||
// Spell can be triggered, we need to check original caster prior to caster
Unit* caster = m_originalCaster ? m_originalCaster : m_caster;

if (caster->GetTypeId() != TYPEID_PLAYER ||
!m_targets.getUnitTarget() ||
m_targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER)
return SPELL_FAILED_BAD_TARGETS;

Player* plrCaster = (Player*)m_caster;
Player* plrCaster = (Player*)caster;

if(plrCaster->getClass() != CLASS_HUNTER)
{
Expand Down
3 changes: 2 additions & 1 deletion src/game/SpellEffects.cpp
Expand Up @@ -4158,7 +4158,8 @@ void Spell::EffectEnchantItemTmp(uint32 i)
void Spell::EffectTameCreature(uint32 /*i*/)
{
// Caster must be player, checked in Spell::CheckCast
Player* plr = (Player*)m_caster;
// Spell can be triggered, we need to check original caster prior to caster
Player* plr = (Player*)(m_originalCaster ? m_originalCaster : m_caster);

Creature* creatureTarget = (Creature*)unitTarget;

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8716"
#define REVISION_NR "8717"
#endif // __REVISION_NR_H__

0 comments on commit fcef298

Please sign in to comment.