*Let owner enter pvp when pet attacks pvp target.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-03 13:35:47 -06:00
parent 3035a78c3d
commit 08d259e0cc
3 changed files with 16 additions and 6 deletions
+2 -2
View File
@@ -1167,13 +1167,13 @@ void Player::Update( uint32 p_time )
} }
} }
Unit *owner = pVictim->GetOwner(); /*Unit *owner = pVictim->GetOwner();
Unit *u = owner ? owner : pVictim; Unit *u = owner ? owner : pVictim;
if(u->IsPvP() && (!duel || duel->opponent != u)) if(u->IsPvP() && (!duel || duel->opponent != u))
{ {
UpdatePvP(true); UpdatePvP(true);
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
} }*/
} }
} }
+2 -2
View File
@@ -647,7 +647,7 @@ void Spell::FillTargetMap()
if(IsChanneledSpell(m_spellInfo) && !tmpUnitMap.empty()) if(IsChanneledSpell(m_spellInfo) && !tmpUnitMap.empty())
m_needAliveTargetMask |= (1<<i); m_needAliveTargetMask |= (1<<i);
if(m_caster->GetTypeId() == TYPEID_PLAYER) /*if(m_caster->GetTypeId() == TYPEID_PLAYER)
{ {
Player *me = (Player*)m_caster; Player *me = (Player*)m_caster;
for (std::list<Unit*>::const_iterator itr = tmpUnitMap.begin(); itr != tmpUnitMap.end(); itr++) for (std::list<Unit*>::const_iterator itr = tmpUnitMap.begin(); itr != tmpUnitMap.end(); itr++)
@@ -661,7 +661,7 @@ void Spell::FillTargetMap()
break; break;
} }
} }
} }*/
for (std::list<Unit*>::iterator itr = tmpUnitMap.begin() ; itr != tmpUnitMap.end();) for (std::list<Unit*>::iterator itr = tmpUnitMap.begin() ; itr != tmpUnitMap.end();)
{ {
+12 -2
View File
@@ -9768,8 +9768,18 @@ void Unit::CombatStart(Unit* target)
target->SetInCombatWith(this); target->SetInCombatWith(this);
} }
if(Player* attackedPlayer = target->GetCharmerOrOwnerPlayerOrPlayerItself()) Unit *who = target->GetCharmerOrOwnerOrSelf();
SetContestedPvP(attackedPlayer); if(who->GetTypeId() == TYPEID_PLAYER)
SetContestedPvP((Player*)who);
Player *me = GetCharmerOrOwnerPlayerOrPlayerItself();
if(me && who->IsPvP()
&& (who->GetTypeId() != TYPEID_PLAYER
|| !me->duel || me->duel->opponent != who))
{
me->UpdatePvP(true);
me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
}
} }
void Unit::SetInCombatState(bool PvP) void Unit::SetInCombatState(bool PvP)