[10371] More wide use ObjectGuid in group code.

Also drop some unused functions.
And fix some uint32 -> uint6 guid assigns.
This commit is contained in:
VladimirMangos 2010-08-18 05:23:50 +04:00
parent acdaac3587
commit dbe9c6f190
19 changed files with 354 additions and 346 deletions

View file

@ -1169,7 +1169,7 @@ void BattleGround::AddPlayer(Player *plr)
// score struct must be created in inherited class
uint64 guid = plr->GetGUID();
ObjectGuid guid = plr->GetObjectGuid();
uint32 team = plr->GetBGTeam();
BattleGroundPlayer bp;
@ -1177,7 +1177,7 @@ void BattleGround::AddPlayer(Player *plr)
bp.Team = team;
// Add to list/maps
m_Players[guid] = bp;
m_Players[guid.GetRawValue()] = bp;
UpdatePlayersCountByTeam(team, false); // +1 player
@ -1235,16 +1235,9 @@ void BattleGround::AddPlayer(Player *plr)
}
/* this method adds player to his team's bg group, or sets his correct group if player is already in bg group */
void BattleGround::AddOrSetPlayerToCorrectBgGroup(Player *plr, uint64 plr_guid, uint32 team)
void BattleGround::AddOrSetPlayerToCorrectBgGroup(Player *plr, ObjectGuid plr_guid, uint32 team)
{
Group* group = GetBgRaid(team);
if(!group) // first player joined
{
group = new Group;
SetBgRaid(team, group);
group->Create(plr_guid, plr->GetName());
}
else // raid already exist
if (Group* group = GetBgRaid(team)) // raid already exist
{
if (group->IsMember(plr_guid))
{
@ -1259,6 +1252,12 @@ void BattleGround::AddOrSetPlayerToCorrectBgGroup(Player *plr, uint64 plr_guid,
group->ChangeLeader(plr_guid);
}
}
else // first player joined
{
group = new Group;
SetBgRaid(team, group);
group->Create(plr_guid, plr->GetName());
}
}
// This method should be called when player logs into running battleground