Core/Phases: Removed some of the usages of phasemask in the Pet code.

This commit is contained in:
Subv committed 2014-10-28 11:35:40 -05:00
1 parent 66a40f5e91
commit 44c14799f3
4 files changed
+12 -10

No files matched your search

+6 -7
View File
@@ -176,7 +176,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
Map* map = owner->GetMap();
uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
if (!Create(guid, map, owner->GetPhaseMask(), petEntry, petId))
if (!Create(guid, map, petEntry, petId))
return false;
for (auto itr : owner->GetPhases())
@@ -726,7 +726,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
{
ASSERT(creature);
if (!CreateBaseAtTamed(creature->GetCreatureTemplate(), creature->GetMap(), creature->GetPhaseMask()))
if (!CreateBaseAtTamed(creature->GetCreatureTemplate(), creature->GetMap()))
return false;
Relocate(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
@@ -757,7 +757,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner)
{
if (!CreateBaseAtTamed(cinfo, owner->GetMap(), owner->GetPhaseMask()))
if (!CreateBaseAtTamed(cinfo, owner->GetMap()))
return false;
if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
@@ -768,12 +768,12 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner)
return true;
}
bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask)
bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map)
{
TC_LOG_DEBUG("entities.pet", "Pet::CreateBaseForTamed");
uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
uint32 petId = sObjectMgr->GeneratePetNumber();
if (!Create(guid, map, phaseMask, cinfo->Entry, petId))
if (!Create(guid, map, cinfo->Entry, petId))
return false;
setPowerType(POWER_FOCUS);
@@ -1866,12 +1866,11 @@ bool Pet::IsPermanentPetFor(Player* owner) const
}
}
bool Pet::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 petId)
bool Pet::Create(uint32 guidlow, Map* map, uint32 Entry, uint32 petId)
{
ASSERT(map);
SetMap(map);
SetPhaseMask(phaseMask, false);
Object::_Create(guidlow, petId, HIGHGUID_PET);
m_DBTableGuid = guidlow;
+2 -2
View File
@@ -55,10 +55,10 @@ class Pet : public Guardian
bool IsPermanentPetFor(Player* owner) const; // pet have tab in character windows and set UNIT_FIELD_PETNUMBER
bool Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 pet_number);
bool Create(uint32 guidlow, Map* map, uint32 Entry, uint32 pet_number);
bool CreateBaseAtCreature(Creature* creature);
bool CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner);
bool CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask);
bool CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map);
bool LoadPetFromDB(Player* owner, uint32 petentry = 0, uint32 petnumber = 0, bool current = false);
bool IsLoading() const override { return m_loading;}
void SavePetToDB(PetSaveMode mode);
+1 -1
View File
@@ -27611,7 +27611,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
Map* map = GetMap();
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, entry, pet_number))
{
TC_LOG_ERROR("misc", "no such creature entry %u", entry);
delete pet;
+3
View File
@@ -13404,6 +13404,9 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
return false;
}
for (auto phase : GetPhases())
pet->SetInPhase(phase, false, true);
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
// this enables pet details window (Shift+P)
pet->InitPetCreateSpells();