diff options
author | megamage <none@none> | 2009-05-26 13:42:48 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-26 13:42:48 -0500 |
commit | 2c67de7004c25471eef5cbde11008db661795202 (patch) | |
tree | 5744876005d4185c121289f74e53d9be9bfbd6f6 /src | |
parent | 7823461e866e31d4c651aa8d7789976aca436050 (diff) |
*Fix a crash caused by charm spells. Thanks to Drahy.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 480eb9f9121..608932b531a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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); } } |