diff options
author | megamage <none@none> | 2008-12-03 13:35:47 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-03 13:35:47 -0600 |
commit | 08d259e0cc3ed1c9b7addee6ad3595776a8af1c3 (patch) | |
tree | 7531829af49d768b40ff9f6c5a3b805fd523c1eb | |
parent | 3035a78c3d545bb02131d533b24fee9088f91d57 (diff) |
*Let owner enter pvp when pet attacks pvp target.
--HG--
branch : trunk
-rw-r--r-- | src/game/Player.cpp | 4 | ||||
-rw-r--r-- | src/game/Spell.cpp | 4 | ||||
-rw-r--r-- | src/game/Unit.cpp | 14 |
3 files changed, 16 insertions, 6 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b00273b65c4..278d43ebc30 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1167,13 +1167,13 @@ void Player::Update( uint32 p_time ) } } - Unit *owner = pVictim->GetOwner(); + /*Unit *owner = pVictim->GetOwner(); Unit *u = owner ? owner : pVictim; if(u->IsPvP() && (!duel || duel->opponent != u)) { UpdatePvP(true); RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); - } + }*/ } } diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index c1c00944b99..07905bb1c37 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -647,7 +647,7 @@ void Spell::FillTargetMap() if(IsChanneledSpell(m_spellInfo) && !tmpUnitMap.empty()) m_needAliveTargetMask |= (1<<i); - if(m_caster->GetTypeId() == TYPEID_PLAYER) + /*if(m_caster->GetTypeId() == TYPEID_PLAYER) { Player *me = (Player*)m_caster; for (std::list<Unit*>::const_iterator itr = tmpUnitMap.begin(); itr != tmpUnitMap.end(); itr++) @@ -661,7 +661,7 @@ void Spell::FillTargetMap() break; } } - } + }*/ for (std::list<Unit*>::iterator itr = tmpUnitMap.begin() ; itr != tmpUnitMap.end();) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6dc5e6201a5..771d6b30ae3 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9768,8 +9768,18 @@ void Unit::CombatStart(Unit* target) target->SetInCombatWith(this); } - if(Player* attackedPlayer = target->GetCharmerOrOwnerPlayerOrPlayerItself()) - SetContestedPvP(attackedPlayer); + Unit *who = target->GetCharmerOrOwnerOrSelf(); + 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) |