diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 6 |
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()) |