refactor(Core/Creature): More functions capitalized (#10012)

* GetLeader

* IsFormed

* build
This commit is contained in:
Kitzunu
2022-02-10 18:40:00 +01:00
committed by GitHub
parent 0fa4a90aa8
commit 9d166722c4
5 changed files with 11 additions and 9 deletions

View File

@@ -993,12 +993,12 @@ void Creature::Motion_Initialize()
{
if (!m_formation)
GetMotionMaster()->Initialize();
else if (m_formation->getLeader() == this)
else if (m_formation->GetLeader() == this)
{
m_formation->FormationReset(false, true);
GetMotionMaster()->Initialize();
}
else if (m_formation->isFormed())
else if (m_formation->IsFormed())
GetMotionMaster()->MoveIdle(); //wait the order of leader
else
GetMotionMaster()->Initialize();
@@ -1849,7 +1849,7 @@ void Creature::setDeathState(DeathState s, bool despawn)
}
//Dismiss group if is leader
if (m_formation && m_formation->getLeader() == this)
if (m_formation && m_formation->GetLeader() == this)
m_formation->FormationReset(true, false);
bool needsFalling = !despawn && (IsFlying() || IsHovering()) && !IsUnderWater();

View File

@@ -91,10 +91,12 @@ public:
explicit CreatureGroup(uint32 id) : m_leader(nullptr), m_groupID(id), m_Formed(false) {}
~CreatureGroup() {}
Creature* getLeader() const { return m_leader; }
Creature* GetLeader() const { return m_leader; }
uint32 GetId() const { return m_groupID; }
bool IsEmpty() const { return m_members.empty(); }
bool isFormed() const { return m_Formed; }
bool IsFormed() const { return m_Formed; }
const CreatureGroupMemberType& GetMembers() const { return m_members; }
void AddMember(Creature* member);