mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
*Fix a crash caused by possessing pet.
--HG-- branch : trunk
This commit is contained in:
@@ -13047,7 +13047,8 @@ 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)->HasSummonMask(SUMMON_MASK_GUARDIAN))
|
||||
if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT
|
||||
&& !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN) && !((Creature*)this)->isPet())
|
||||
{
|
||||
CharmInfo *charmInfo = InitCharmInfo();
|
||||
if(possess)
|
||||
@@ -13168,7 +13169,8 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer)
|
||||
}
|
||||
|
||||
//a guardian should always have charminfo
|
||||
if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN))
|
||||
if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT
|
||||
&& !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN) && !((Creature*)this)->isPet())
|
||||
{
|
||||
DeleteCharmInfo();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user