Core/Misc: camelize GetFaction/SetFaction properly
(cherry picked from commit 4c4dca6d694bd1064b403a31a5b1c776a326f3ce)
This commit is contained in:
@@ -5429,15 +5429,15 @@ void Unit::UpdateDisplayPower()
|
||||
|
||||
FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const
|
||||
{
|
||||
FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction());
|
||||
FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(GetFaction());
|
||||
if (!entry)
|
||||
{
|
||||
if (Player const* player = ToPlayer())
|
||||
TC_LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), getFaction());
|
||||
TC_LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), GetFaction());
|
||||
else if (Creature const* creature = ToCreature())
|
||||
TC_LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
|
||||
TC_LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, GetFaction());
|
||||
else
|
||||
TC_LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), getFaction());
|
||||
TC_LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), GetFaction());
|
||||
|
||||
ABORT();
|
||||
}
|
||||
@@ -11225,7 +11225,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id)
|
||||
bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
|
||||
{
|
||||
pet->SetCreatorGUID(GetGUID());
|
||||
pet->setFaction(getFaction());
|
||||
pet->SetFaction(GetFaction());
|
||||
pet->SetCreatedBySpell(spell_id);
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -11881,8 +11881,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
if (aurApp && aurApp->GetRemoveMode())
|
||||
return false;
|
||||
|
||||
_oldFactionId = getFaction();
|
||||
setFaction(charmer->getFaction());
|
||||
_oldFactionId = GetFaction();
|
||||
SetFaction(charmer->GetFaction());
|
||||
|
||||
// Set charmed
|
||||
charmer->SetCharm(this, true);
|
||||
@@ -11998,7 +11998,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
|
||||
if (_oldFactionId)
|
||||
{
|
||||
setFaction(_oldFactionId);
|
||||
SetFaction(_oldFactionId);
|
||||
_oldFactionId = 0;
|
||||
}
|
||||
else
|
||||
@@ -12090,13 +12090,13 @@ void Unit::RestoreFaction()
|
||||
{
|
||||
if (Unit* owner = GetOwner())
|
||||
{
|
||||
setFaction(owner->getFaction());
|
||||
SetFaction(owner->GetFaction());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate()) // normal creature
|
||||
setFaction(cinfo->faction);
|
||||
SetFaction(cinfo->faction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12191,7 +12191,7 @@ bool Unit::IsInPartyWith(Unit const* unit) const
|
||||
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
|
||||
return true;
|
||||
|
||||
return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->getFaction() == u2->getFaction();
|
||||
return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->GetFaction() == u2->GetFaction();
|
||||
}
|
||||
|
||||
bool Unit::IsInRaidWith(Unit const* unit) const
|
||||
@@ -12210,7 +12210,7 @@ bool Unit::IsInRaidWith(Unit const* unit) const
|
||||
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
|
||||
return true;
|
||||
|
||||
return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->getFaction() == u2->getFaction();
|
||||
return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->GetFaction() == u2->GetFaction();
|
||||
}
|
||||
|
||||
void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
|
||||
|
||||
Reference in New Issue
Block a user