[8718] Remove most GetObjectInWorld functions and move some map local to Map

Also mape pet guid counter per-map (in different expecte to be global pet number)
This commit is contained in:
VladimirMangos 2009-10-23 03:56:46 +04:00
parent 40b0a2cd92
commit d7ae5e3af0
20 changed files with 135 additions and 132 deletions

View file

@ -3386,7 +3386,7 @@ void Spell::EffectSummon(uint32 i)
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
if (!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
m_spellInfo->EffectMiscValue[i], pet_number))
{
sLog.outErrorDb("Spell::EffectSummon: no such creature entry %u",m_spellInfo->EffectMiscValue[i]);
@ -3801,7 +3801,7 @@ void Spell::EffectSummonGuardian(uint32 i)
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
if (!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map,m_caster->GetPhaseMask(),
if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map,m_caster->GetPhaseMask(),
m_spellInfo->EffectMiscValue[i], pet_number))
{
sLog.outError("no such creature entry %u", m_spellInfo->EffectMiscValue[i]);
@ -4270,7 +4270,7 @@ void Spell::EffectSummonPet(uint32 i)
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
if(!NewSummon->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
if(!NewSummon->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
petentry, pet_number))
{
delete NewSummon;
@ -6291,7 +6291,7 @@ void Spell::EffectSummonCritter(uint32 i)
Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
if(!critter->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
if(!critter->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
pet_entry, pet_number))
{
sLog.outError("Spell::EffectSummonCritter, spellid %u: no such creature entry %u", m_spellInfo->Id, pet_entry);