aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp4
-rw-r--r--src/game/Spell.cpp4
-rw-r--r--src/game/Unit.cpp14
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)