*Fix the bug that summoned guardians cause crash (do not use the previous one).

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-30 22:01:45 -06:00
parent 815a7641d2
commit 1d800d912c
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -257,7 +257,7 @@ template<>
void Map::AddToGrid(Creature* obj, NGridType *grid, Cell const& cell)
{
// add to world object registry in grid
if(obj->isPet() && IS_PLAYER_GUID(obj->GetOwnerGUID()) || obj->isPossessedByPlayer())
if(obj->isPet() /*&& IS_PLAYER_GUID(obj->GetOwnerGUID())*/ || obj->isPossessedByPlayer())
{
(*grid)(cell.CellX(), cell.CellY()).AddWorldObject<Creature>(obj, obj->GetGUID());
obj->SetCurrentCell(cell);
+8 -1
View File
@@ -3575,7 +3575,7 @@ void Spell::EffectSummonGuardian(uint32 i)
}
// trigger
if(m_spellInfo->Id == 40276)
if(!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER /*m_spellInfo->Id == 40276*/)
{
EffectSummonWild(i);
return;
@@ -3987,6 +3987,12 @@ void Spell::EffectTameCreature(uint32 /*i*/)
void Spell::EffectSummonPet(uint32 i)
{
if(!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER)
{
EffectSummonWild(i);
return;
}
uint32 petentry = m_spellInfo->EffectMiscValue[i];
Pet *OldSummon = m_caster->GetPet();
@@ -5768,6 +5774,7 @@ void Spell::EffectSummonCritter(uint32 i)
// summon new pet
Pet* critter = new Pet(MINI_PET);
critter->setActive(m_caster->isActive());
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();