*Do not delete charminfo for guardian.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-20 14:38:53 -06:00
parent 4776c384aa
commit f3a543bef3
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -446,7 +446,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
void GetRespawnCoord(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const;
uint32 GetEquipmentId() const { return m_equipmentId; }
uint32 GetSummonMask() const { return m_summonMask; }
uint32 HasSummonMask(uint32 mask) const { return mask & m_summonMask; }
bool isSummon() const { return m_summonMask & SUMMON_MASK_SUMMON; }
bool isPet() const { return m_summonMask & SUMMON_MASK_PET; }
bool isVehicle() const { return m_summonMask & SUMMON_MASK_VEHICLE; }
+1 -1
View File
@@ -6615,7 +6615,7 @@ void Spell::SummonGuardian(uint32 entry, SummonPropertiesEntry const *properties
if(!summon)
return;
if(summon->GetSummonMask() | SUMMON_MASK_GUARDIAN)
if(summon->HasSummonMask(SUMMON_MASK_GUARDIAN))
((Guardian*)summon)->InitStatsForLevel(level);
summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
+3 -3
View File
@@ -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();
}