From 370be1de8e89628562ee05c3dbb1ed8dec0abb60 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 4 Sep 2009 09:33:46 -0500 Subject: *Fix a bug that pvp flag is not cleared after unit is uncharmed. --HG-- branch : trunk --- src/game/Unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b613c2b9ade..7227696b533 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8732,6 +8732,9 @@ void Unit::SetCharm(Unit* charm, bool apply) sLog.outCrash("Player %s is trying to uncharm unit %u, but it has another charmed unit %u", GetName(), charm->GetEntry(), GetCharmGUID()); } + if(!charm->RemoveUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID())) + sLog.outCrash("Unit %u is being uncharmed, but it has another charmer %u", charm->GetEntry(), charm->GetCharmerGUID()); + if(charm->GetTypeId() == TYPEID_PLAYER) { charm->m_ControlledByPlayer = true; @@ -8751,9 +8754,6 @@ void Unit::SetCharm(Unit* charm, bool apply) charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, 0); } - if(!charm->RemoveUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID())) - sLog.outCrash("Unit %u is being uncharmed, but it has another charmer %u", charm->GetEntry(), charm->GetCharmerGUID()); - if(charm->GetTypeId() == TYPEID_PLAYER || !((Creature*)charm)->HasUnitTypeMask(UNIT_MASK_MINION) || charm->GetOwnerGUID() != GetGUID()) -- cgit v1.2.3