*Fix a crash caused by charm spells. Thanks to Drahy.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-26 13:42:48 -05:00
parent 7823461e86
commit 2c67de7004
+3 -1
View File
@@ -8470,7 +8470,9 @@ void Unit::SetCharm(Unit* charm, bool apply)
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->GetOwnerGUID() != GetGUID())
if(charm->GetTypeId() == TYPEID_PLAYER
|| !((Creature*)charm)->HasSummonMask(SUMMON_MASK_MINION)
|| charm->GetOwnerGUID() != GetGUID())
m_Controlled.erase(charm);
}
}