aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp14
1 files changed, 12 insertions, 2 deletions
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)