*Let owner enter pvp when pet attacks pvp target.
--HG-- branch : trunk
This commit is contained in:
+2
-2
@@ -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
@@ -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
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user