From f3a543bef3690dae643653ff97120db17ba13d34 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 20 Mar 2009 14:38:53 -0600 Subject: *Do not delete charminfo for guardian. --HG-- branch : trunk --- src/game/Unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 77f0a0eb4c3..94baed9e8d3 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -13228,7 +13228,7 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess) } // Pets already have a properly initialized CharmInfo, don't overwrite it. - if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet()) + if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN)) { CharmInfo *charmInfo = InitCharmInfo(); if(possess) @@ -13347,9 +13347,9 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer) } } - if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet()) + //a guardian should always have charminfo + if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN)) { - //TODO: this will cause crash when a guardian is charmed DeleteCharmInfo(); } -- cgit v1.2.3