From 2c67de7004c25471eef5cbde11008db661795202 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 26 May 2009 13:42:48 -0500 Subject: *Fix a crash caused by charm spells. Thanks to Drahy. --HG-- branch : trunk --- src/game/Unit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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); } } -- cgit v1.2.3