diff options
author | megamage <none@none> | 2008-12-30 22:01:45 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-30 22:01:45 -0600 |
commit | 1d800d912ccb3b62879708235d302afc2be9c73a (patch) | |
tree | 0940aaae03d35bfc8d75e45b9438baf2c54091fa /src | |
parent | 815a7641d257256479273e24e5e1052737428c80 (diff) |
*Fix the bug that summoned guardians cause crash (do not use the previous one).
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Map.cpp | 2 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index f8e5077d52f..0bf1d5b7bf2 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -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); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index e693cd9adbd..d3e503d47b2 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -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(); |