Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there

This commit is contained in:
Spp
2012-02-27 14:58:47 +01:00
parent 3e622ee7ac
commit d38bc3a178
47 changed files with 317 additions and 317 deletions
+11 -11
View File
@@ -180,7 +180,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
setFaction(owner->getFaction());
SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id);
CreatureTemplate const* cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureTemplate();
if (cinfo->type == CREATURE_TYPE_CRITTER)
{
map->AddToMap(this->ToCreature());
@@ -692,7 +692,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
{
ASSERT(creature);
if (!CreateBaseAtTamed(creature->GetCreatureInfo(), creature->GetMap(), creature->GetPhaseMask()))
if (!CreateBaseAtTamed(creature->GetCreatureTemplate(), creature->GetMap(), creature->GetPhaseMask()))
return false;
Relocate(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
@@ -704,7 +704,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
return false;
}
CreatureTemplate const* cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureTemplate();
if (!cinfo)
{
sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
@@ -763,7 +763,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas
// TODO: Move stat mods code to pet passive auras
bool Guardian::InitStatsForLevel(uint8 petlevel)
{
CreatureTemplate const* cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureTemplate();
ASSERT(cinfo);
SetLevel(petlevel);
@@ -997,7 +997,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const
if (!item->FoodType)
return false;
CreatureTemplate const* cInfo = GetCreatureInfo();
CreatureTemplate const* cInfo = GetCreatureTemplate();
if (!cInfo)
return false;
@@ -1405,7 +1405,7 @@ void Pet::InitLevelupSpellsForLevel()
{
uint8 level = getLevel();
if (PetLevelupSpellSet const* levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : NULL)
{
// PetLevelupSpellSet ordered by levels, process in reversed order
for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
@@ -1419,7 +1419,7 @@ void Pet::InitLevelupSpellsForLevel()
}
}
int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry();
int32 petSpellsId = GetCreatureTemplate()->PetSpellDataId ? -(int32)GetCreatureTemplate()->PetSpellDataId : GetEntry();
// default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game)
if (PetDefaultSpellsEntry const* defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId))
@@ -1543,7 +1543,7 @@ bool Pet::resetTalents()
if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS, true);
CreatureTemplate const* ci = GetCreatureInfo();
CreatureTemplate const* ci = GetCreatureTemplate();
if (!ci)
return false;
// Check pet talent type
@@ -1771,9 +1771,9 @@ bool Pet::IsPermanentPetFor(Player* owner)
switch (owner->getClass())
{
case CLASS_WARLOCK:
return GetCreatureInfo()->type == CREATURE_TYPE_DEMON;
return GetCreatureTemplate()->type == CREATURE_TYPE_DEMON;
case CLASS_DEATH_KNIGHT:
return GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD;
return GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD;
default:
return false;
}
@@ -1812,7 +1812,7 @@ bool Pet::HasSpell(uint32 spell) const
// Get all passive spells in our skill line
void Pet::LearnPetPassives()
{
CreatureTemplate const* cInfo = GetCreatureInfo();
CreatureTemplate const* cInfo = GetCreatureTemplate();
if (!cInfo)
return;