mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
*Fix a bug that pvp flag is not cleared after unit is uncharmed.
--HG-- branch : trunk
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user