aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-03 13:35:47 -0600
committermegamage <none@none>2008-12-03 13:35:47 -0600
commit08d259e0cc3ed1c9b7addee6ad3595776a8af1c3 (patch)
tree7531829af49d768b40ff9f6c5a3b805fd523c1eb /src/game/Unit.cpp
parent3035a78c3d545bb02131d533b24fee9088f91d57 (diff)
*Let owner enter pvp when pet attacks pvp target.
--HG-- branch : trunk
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)