mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10800] Use ObjectGuid in some battleground structures.
Also fix some catches bugs in code in result.
This commit is contained in:
parent
ce7b98c45e
commit
6d13cd6553
33 changed files with 146 additions and 139 deletions
|
|
@ -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) )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue