[10800] Use ObjectGuid in some battleground structures.

Also fix some catches bugs in code in result.
This commit is contained in:
VladimirMangos 2010-12-01 11:20:17 +03:00
parent ce7b98c45e
commit 6d13cd6553
33 changed files with 146 additions and 139 deletions

View file

@ -15249,7 +15249,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
{
BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE);
bool player_at_bg = currentBg && currentBg->IsPlayerInBattleGround(GetGUID());
bool player_at_bg = currentBg && currentBg->IsPlayerInBattleGround(GetObjectGuid());
if(player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE)
{
@ -15259,7 +15259,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
m_bgData.bgTypeID = currentBg->GetTypeID();
//join player to battleground group
currentBg->EventPlayerLoggedIn(this, GetGUID());
currentBg->EventPlayerLoggedIn(this, GetObjectGuid());
currentBg->AddOrSetPlayerToCorrectBgGroup(this, GetObjectGuid(), m_bgData.bgTeam);
SetInviteForBattleGroundQueueType(bgQueueTypeId,currentBg->GetInstanceID());
@ -15268,7 +15268,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
{
// leave bg
if (player_at_bg)
currentBg->RemovePlayerAtLeave(GetGUID(), false, true);
currentBg->RemovePlayerAtLeave(GetObjectGuid(), false, true);
// move to bg enter point
const WorldLocation& _loc = GetBattleGroundEntryPoint();
@ -19300,7 +19300,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
{
if(BattleGround *bg = GetBattleGround())
{
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
bg->RemovePlayerAtLeave(GetObjectGuid(), teleportToEntryPoint, true);
// call after remove to be sure that player resurrected for correct cast
if( bg->isBattleGround() && !isGameMaster() && sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_CAST_DESERTER) )