aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-09-04 09:33:46 -0500
committermegamage <none@none>2009-09-04 09:33:46 -0500
commit370be1de8e89628562ee05c3dbb1ed8dec0abb60 (patch)
treed10ca13a9a0b6e812c48f3cb3db0ff3a87b8939a
parent8c255266e7c38096ddf9d3e29eadd35ca46e4c4d (diff)
*Fix a bug that pvp flag is not cleared after unit is uncharmed.
--HG-- branch : trunk
-rw-r--r--src/game/Unit.cpp6
1 files changed, 3 insertions, 3 deletions
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())