mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 00:23:48 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -34,7 +34,7 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member)
|
||||
if (itr != map->CreatureGroupHolder.end())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId());
|
||||
LOG_DEBUG("entities.unit", "Group found: %u, inserting creature %s, Group InstanceID %u", groupId, member->GetGUID().ToString().c_str(), member->GetInstanceId());
|
||||
#endif
|
||||
itr->second->AddMember(member);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member)
|
||||
void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* member)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow());
|
||||
LOG_DEBUG("entities.unit", "Deleting member pointer to spawnId: %u from group %u", member->GetSpawnId(), group->GetId());
|
||||
#endif
|
||||
group->RemoveMember(member);
|
||||
|
||||
@@ -100,7 +100,7 @@ void FormationMgr::LoadCreatureFormations()
|
||||
//Load group member data
|
||||
group_member = new FormationInfo();
|
||||
group_member->leaderGUID = fields[0].GetUInt32();
|
||||
uint32 memberGUID = fields[1].GetUInt32();
|
||||
ObjectGuid::LowType memberGUID = fields[1].GetUInt32();
|
||||
group_member->groupAI = fields[4].GetUInt32();
|
||||
group_member->point_1 = fields[5].GetUInt16();
|
||||
group_member->point_2 = fields[6].GetUInt16();
|
||||
@@ -144,19 +144,19 @@ void FormationMgr::LoadCreatureFormations()
|
||||
void CreatureGroup::AddMember(Creature* member)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow());
|
||||
LOG_DEBUG("entities.unit", "CreatureGroup::AddMember: Adding unit %s.", member->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
|
||||
//Check if it is a leader
|
||||
if (member->GetDBTableGUIDLow() == m_groupID)
|
||||
if (member->GetSpawnId() == m_groupID)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow());
|
||||
LOG_DEBUG("entities.unit", "Unit %s is formation leader. Adding group.", member->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
m_leader = member;
|
||||
}
|
||||
|
||||
m_members[member] = sFormationMgr->CreatureGroupMap.find(member->GetDBTableGUIDLow())->second;
|
||||
m_members[member] = sFormationMgr->CreatureGroupMap.find(member->GetSpawnId())->second;
|
||||
member->SetFormation(this);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ void CreatureGroup::RemoveMember(Creature* member)
|
||||
|
||||
void CreatureGroup::MemberAttackStart(Creature* member, Unit* target)
|
||||
{
|
||||
uint8 groupAI = sFormationMgr->CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI;
|
||||
uint8 groupAI = sFormationMgr->CreatureGroupMap[member->GetSpawnId()]->groupAI;
|
||||
if (!groupAI)
|
||||
return;
|
||||
|
||||
@@ -214,7 +214,7 @@ void CreatureGroup::FormationReset(bool dismiss)
|
||||
else
|
||||
itr->first->GetMotionMaster()->MoveIdle();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow());
|
||||
LOG_DEBUG("entities.unit", "Set %s movement for member %s", dismiss ? "default" : "idle", itr->first->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -228,7 +228,7 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z, bool run)
|
||||
if (!m_leader)
|
||||
return;
|
||||
|
||||
uint8 groupAI = sFormationMgr->CreatureGroupMap[m_leader->GetDBTableGUIDLow()]->groupAI;
|
||||
uint8 groupAI = sFormationMgr->CreatureGroupMap[m_leader->GetSpawnId()]->groupAI;
|
||||
if (groupAI == 5)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user