mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7276] Rewrited fix for same faction arena matches
Added better Object-oriented calls to BattleGround::Reset() Added more checks to CreateBattleGround() method This commit doesn't fix anything
This commit is contained in:
parent
bd89568993
commit
1eadd9b7b4
19 changed files with 107 additions and 115 deletions
|
|
@ -177,6 +177,7 @@ void BattleGround::Update(uint32 diff)
|
|||
}
|
||||
}
|
||||
|
||||
//this should be handled by spell system:
|
||||
m_LastResurrectTime += diff;
|
||||
if (m_LastResurrectTime >= RESURRECTION_INTERVAL)
|
||||
{
|
||||
|
|
@ -304,7 +305,7 @@ void BattleGround::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *
|
|||
if(!self && sender == plr)
|
||||
continue;
|
||||
|
||||
uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
|
||||
uint32 team = itr->second.Team;
|
||||
if(!team) team = plr->GetTeam();
|
||||
|
||||
if(team == TeamID)
|
||||
|
|
@ -333,7 +334,7 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
|
|||
continue;
|
||||
}
|
||||
|
||||
uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
|
||||
uint32 team = itr->second.Team;
|
||||
if(!team) team = plr->GetTeam();
|
||||
|
||||
if(team == TeamID)
|
||||
|
|
@ -356,7 +357,7 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
|
|||
continue;
|
||||
}
|
||||
|
||||
uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
|
||||
uint32 team = itr->second.Team;
|
||||
if(!team) team = plr->GetTeam();
|
||||
|
||||
if(team == TeamID)
|
||||
|
|
@ -376,7 +377,7 @@ void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
|
|||
continue;
|
||||
}
|
||||
|
||||
uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
|
||||
uint32 team = itr->second.Team;
|
||||
if(!team) team = plr->GetTeam();
|
||||
|
||||
if(team == TeamID)
|
||||
|
|
@ -401,7 +402,7 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
|
|||
continue;
|
||||
}
|
||||
|
||||
uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
|
||||
uint32 team = itr->second.Team;
|
||||
if(!team) team = plr->GetTeam();
|
||||
|
||||
if(team == TeamID)
|
||||
|
|
@ -889,9 +890,6 @@ void BattleGround::Reset()
|
|||
|
||||
m_Players.clear();
|
||||
m_PlayerScores.clear();
|
||||
|
||||
// reset BGSubclass
|
||||
ResetBGSubclass();
|
||||
}
|
||||
|
||||
void BattleGround::StartBattleGround()
|
||||
|
|
@ -972,10 +970,37 @@ void BattleGround::AddPlayer(Player *plr)
|
|||
plr->CastSpell(plr, SPELL_PREPARATION, true); // reduces all mana cost of spells.
|
||||
}
|
||||
|
||||
// setup BG group membership
|
||||
PlayerRelogin(plr);
|
||||
AddOrSetPlayerToCorrectBgGroup(plr, guid, team);
|
||||
|
||||
// Log
|
||||
sLog.outDetail("BATTLEGROUND: Player %s joined the battle.", plr->GetName());
|
||||
}
|
||||
|
||||
/* 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)
|
||||
{
|
||||
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->IsMember(plr_guid))
|
||||
{
|
||||
uint8 subgroup = group->GetMemberGroup(plr_guid);
|
||||
plr->SetGroup(group, subgroup);
|
||||
}
|
||||
else
|
||||
GetBgRaid(team)->AddMember(plr_guid, plr->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* This method should be called only once ... it adds pointer to queue */
|
||||
void BattleGround::AddToBGFreeSlotQueue()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -248,10 +248,7 @@ class BattleGround
|
|||
{
|
||||
return true;
|
||||
}
|
||||
void Reset(); // resets all common properties for battlegrounds
|
||||
virtual void ResetBGSubclass() // must be implemented in BG subclass
|
||||
{
|
||||
}
|
||||
virtual void Reset(); // resets all common properties for battlegrounds, must be implemented and called in BG subclass
|
||||
|
||||
/* Battleground */
|
||||
// Get methods:
|
||||
|
|
@ -411,6 +408,8 @@ class BattleGround
|
|||
|
||||
virtual void AddPlayer(Player *plr); // must be implemented in BG subclass
|
||||
|
||||
void AddOrSetPlayerToCorrectBgGroup(Player *plr, uint64 plr_guid, uint32 team);
|
||||
|
||||
virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket);
|
||||
// can be extended in in BG subclass
|
||||
|
||||
|
|
|
|||
|
|
@ -576,8 +576,11 @@ bool BattleGroundAB::SetupBattleGround()
|
|||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundAB::ResetBGSubclass()
|
||||
void BattleGroundAB::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
|
||||
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
|
||||
m_TeamScores[BG_TEAM_HORDE] = 0;
|
||||
m_lastTick[BG_TEAM_ALLIANCE] = 0;
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ class BattleGroundAB : public BattleGround
|
|||
void RemovePlayer(Player *plr,uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
virtual bool SetupBattleGround();
|
||||
virtual void ResetBGSubclass();
|
||||
virtual void Reset();
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 team);
|
||||
|
||||
/* Scorekeeping */
|
||||
|
|
|
|||
|
|
@ -200,9 +200,10 @@ void BattleGroundBE::FillInitialWorldStates(WorldPacket &data)
|
|||
data << uint32(0x9f3) << uint32(1); // 9
|
||||
}
|
||||
|
||||
void BattleGroundBE::ResetBGSubclass()
|
||||
void BattleGroundBE::Reset()
|
||||
{
|
||||
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
}
|
||||
|
||||
bool BattleGroundBE::SetupBattleGround()
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class BattleGroundBE : public BattleGround
|
|||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
void ResetBGSubclass();
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
|
|
|
|||
|
|
@ -513,8 +513,11 @@ bool BattleGroundEY::SetupBattleGround()
|
|||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundEY::ResetBGSubclass()
|
||||
void BattleGroundEY::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
|
||||
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
|
||||
m_TeamScores[BG_TEAM_HORDE] = 0;
|
||||
m_TeamPointsCount[BG_TEAM_ALLIANCE] = 0;
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ class BattleGroundEY : public BattleGround
|
|||
void HandleKillPlayer(Player *player, Player *killer);
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 team);
|
||||
virtual bool SetupBattleGround();
|
||||
virtual void ResetBGSubclass();
|
||||
virtual void Reset();
|
||||
void UpdateTeamScore(uint32 Team);
|
||||
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
|
||||
virtual void FillInitialWorldStates(WorldPacket& data);
|
||||
|
|
|
|||
|
|
@ -53,12 +53,6 @@ INSTANTIATE_SINGLETON_1( BattleGroundMgr );
|
|||
BattleGroundQueue::BattleGroundQueue()
|
||||
{
|
||||
//queues are empty, we don't have to call clear()
|
||||
/* for (int i = 0; i < MAX_BATTLEGROUND_QUEUES; i++)
|
||||
{
|
||||
//m_QueuedPlayers[i].Horde = 0;
|
||||
//m_QueuedPlayers[i].Alliance = 0;
|
||||
//m_QueuedPlayers[i].AverageTime = 0;
|
||||
}*/
|
||||
}
|
||||
|
||||
BattleGroundQueue::~BattleGroundQueue()
|
||||
|
|
@ -1479,9 +1473,8 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
|
|||
bg = new BattleGroundRV(*(BattleGroundRV*)bg_template);
|
||||
break;
|
||||
default:
|
||||
//bg = new BattleGround;
|
||||
//error, but it is handled few lines above
|
||||
return 0;
|
||||
break; // placeholder for non implemented BG
|
||||
}
|
||||
|
||||
// generate a new instance id
|
||||
|
|
@ -1509,11 +1502,10 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
|
|||
}
|
||||
|
||||
// used to create the BG templates
|
||||
uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO)
|
||||
uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO)
|
||||
{
|
||||
// Create the BG
|
||||
BattleGround *bg = NULL;
|
||||
|
||||
switch(bgTypeId)
|
||||
{
|
||||
case BATTLEGROUND_AV: bg = new BattleGroundAV; break;
|
||||
|
|
@ -1534,19 +1526,13 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, uint32 M
|
|||
|
||||
bg->Reset();
|
||||
|
||||
BattlemasterListEntry const *bl = sBattlemasterListStore.LookupEntry(bgTypeId);
|
||||
//in previous method is checked if exists entry in sBattlemasterListStore, so no check needed
|
||||
if (bl)
|
||||
{
|
||||
bg->SetArenaorBGType(bl->type == TYPE_ARENA);
|
||||
}
|
||||
|
||||
bg->SetTypeID(bgTypeId);
|
||||
bg->SetInstanceID(0); // template bg, instance id is 0
|
||||
bg->SetInstanceID(0);
|
||||
bg->SetArenaorBGType(IsArena);
|
||||
bg->SetMinPlayersPerTeam(MinPlayersPerTeam);
|
||||
bg->SetMaxPlayersPerTeam(MaxPlayersPerTeam);
|
||||
bg->SetMinPlayers(MinPlayersPerTeam*2);
|
||||
bg->SetMaxPlayers(MaxPlayersPerTeam*2);
|
||||
bg->SetMinPlayers(MinPlayersPerTeam * 2);
|
||||
bg->SetMaxPlayers(MaxPlayersPerTeam * 2);
|
||||
bg->SetName(BattleGroundName);
|
||||
bg->SetTeamStartLoc(ALLIANCE, Team1StartLocX, Team1StartLocY, Team1StartLocZ, Team1StartLocO);
|
||||
bg->SetTeamStartLoc(HORDE, Team2StartLocX, Team2StartLocY, Team2StartLocZ, Team2StartLocO);
|
||||
|
|
@ -1568,6 +1554,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
uint32 MaxPlayersPerTeam, MinPlayersPerTeam, MinLvl, MaxLvl, start1, start2;
|
||||
BattlemasterListEntry const *bl;
|
||||
WorldSafeLocsEntry const *start;
|
||||
bool IsArena;
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
|
|
@ -1598,28 +1585,28 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
bl = sBattlemasterListStore.LookupEntry(bgTypeID_);
|
||||
if(!bl)
|
||||
{
|
||||
sLog.outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.",bgTypeID_);
|
||||
sLog.outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
|
||||
continue;
|
||||
}
|
||||
|
||||
BattleGroundTypeId bgTypeID = BattleGroundTypeId(bgTypeID_);
|
||||
|
||||
IsArena = (bl->type == TYPE_ARENA);
|
||||
MinPlayersPerTeam = fields[1].GetUInt32();
|
||||
MaxPlayersPerTeam = fields[2].GetUInt32();
|
||||
MinLvl = fields[3].GetUInt32();
|
||||
MaxLvl = fields[4].GetUInt32();
|
||||
//check values from DB
|
||||
if( MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0 || MinPlayersPerTeam > MaxPlayersPerTeam )
|
||||
{
|
||||
MaxPlayersPerTeam = bl->maxplayersperteam;
|
||||
MinPlayersPerTeam = bl->maxplayersperteam/2;
|
||||
MinPlayersPerTeam = bl->maxplayersperteam / 2;
|
||||
}
|
||||
if( MinLvl == 0 || MaxLvl == 0 || MinLvl > MaxLvl )
|
||||
{
|
||||
MinLvl = bl->minlvl;
|
||||
MaxLvl = bl->maxlvl;
|
||||
|
||||
if(fields[1].GetUInt32())
|
||||
MinPlayersPerTeam = fields[1].GetUInt32();
|
||||
|
||||
if(fields[2].GetUInt32())
|
||||
MaxPlayersPerTeam = fields[2].GetUInt32();
|
||||
|
||||
if(fields[3].GetUInt32())
|
||||
MinLvl = fields[3].GetUInt32();
|
||||
|
||||
if(fields[4].GetUInt32())
|
||||
MaxLvl = fields[4].GetUInt32();
|
||||
}
|
||||
|
||||
start1 = fields[5].GetUInt32();
|
||||
|
||||
|
|
@ -1640,7 +1627,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
}
|
||||
else
|
||||
{
|
||||
sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.",bgTypeID,start1);
|
||||
sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", bgTypeID, start1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1663,12 +1650,12 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
|||
}
|
||||
else
|
||||
{
|
||||
sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.",bgTypeID,start2);
|
||||
sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", bgTypeID, start2);
|
||||
continue;
|
||||
}
|
||||
|
||||
//sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl);
|
||||
if(!CreateBattleGround(bgTypeID, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3]))
|
||||
if(!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3]))
|
||||
continue;
|
||||
|
||||
++count;
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class BattleGroundMgr
|
|||
BattleGround * GetBattleGroundTemplate(BattleGroundTypeId bgTypeId);
|
||||
BattleGround * CreateNewBattleGround(BattleGroundTypeId bgTypeId);
|
||||
|
||||
uint32 CreateBattleGround(BattleGroundTypeId bgTypeId, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO);
|
||||
uint32 CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO);
|
||||
|
||||
void AddBattleGround(uint32 InstanceID, BattleGround* BG) { m_BattleGrounds[InstanceID] = BG; };
|
||||
void RemoveBattleGround(uint32 instanceID) { m_BattleGrounds.erase(instanceID); }
|
||||
|
|
|
|||
|
|
@ -193,9 +193,10 @@ void BattleGroundNA::FillInitialWorldStates(WorldPacket &data)
|
|||
data << uint32(0xa11) << uint32(1); // 9
|
||||
}
|
||||
|
||||
void BattleGroundNA::ResetBGSubclass()
|
||||
void BattleGroundNA::Reset()
|
||||
{
|
||||
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
}
|
||||
|
||||
bool BattleGroundNA::SetupBattleGround()
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class BattleGroundNA : public BattleGround
|
|||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
virtual void ResetBGSubclass();
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
|
|
|
|||
|
|
@ -195,9 +195,10 @@ void BattleGroundRL::FillInitialWorldStates(WorldPacket &data)
|
|||
data << uint32(0xbba) << uint32(1); // 9
|
||||
}
|
||||
|
||||
void BattleGroundRL::ResetBGSubclass()
|
||||
void BattleGroundRL::Reset()
|
||||
{
|
||||
|
||||
//call parent's reset
|
||||
BattleGround::Reset();
|
||||
}
|
||||
|
||||
bool BattleGroundRL::SetupBattleGround()
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ class BattleGroundRL : public BattleGround
|
|||
|
||||
/* inherited from BattlegroundClass */
|
||||
virtual void AddPlayer(Player *plr);
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
|
||||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
virtual void ResetBGSubclass();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -629,8 +629,11 @@ bool BattleGroundWS::SetupBattleGround()
|
|||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundWS::ResetBGSubclass()
|
||||
void BattleGroundWS::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
|
||||
m_FlagKeepers[BG_TEAM_ALLIANCE] = 0;
|
||||
m_FlagKeepers[BG_TEAM_HORDE] = 0;
|
||||
m_DroppedFlagGUID[BG_TEAM_ALLIANCE] = 0;
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class BattleGroundWS : public BattleGround
|
|||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
void HandleKillPlayer(Player *player, Player *killer);
|
||||
bool SetupBattleGround();
|
||||
virtual void ResetBGSubclass();
|
||||
virtual void Reset();
|
||||
|
||||
void UpdateFlagState(uint32 team, uint32 value);
|
||||
void UpdateTeamScore(uint32 team);
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||
// cleanup seting if outdated
|
||||
if(!mEntry->IsBattleGroundOrArena())
|
||||
{
|
||||
// Do next only if found in battleground
|
||||
_player->SetBattleGroundId(0); // We're not in BG.
|
||||
// reset destination bg team
|
||||
_player->SetBGTeam(0);
|
||||
|
|
|
|||
|
|
@ -1518,7 +1518,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
|||
}
|
||||
else
|
||||
{
|
||||
sLog.outDebug("Player %s will teleported to map %u", GetName(), mapid);
|
||||
sLog.outDebug("Player %s is being teleported to map %u", GetName(), mapid);
|
||||
}
|
||||
|
||||
// if we were on a transport, leave
|
||||
|
|
@ -14186,6 +14186,10 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
SetBattleGroundId(currentBg->GetInstanceID());
|
||||
SetBGTeam(bgteam);
|
||||
|
||||
//join player to battleground group
|
||||
currentBg->PlayerRelogin(this);
|
||||
currentBg->AddOrSetPlayerToCorrectBgGroup(this, GetGUID(), bgteam);
|
||||
|
||||
SetInviteForBattleGroundQueueType(bgQueueTypeId,currentBg->GetInstanceID());
|
||||
}
|
||||
else
|
||||
|
|
@ -18107,40 +18111,6 @@ void Player::SendInitialPacketsAfterAddToMap()
|
|||
SendMessageToSet(&data,true);
|
||||
}
|
||||
|
||||
// setup BG group membership if need
|
||||
if(BattleGround* currentBg = GetBattleGround())
|
||||
{
|
||||
// call for invited (join) or listed (relogin) and avoid other cases (GM teleport)
|
||||
if (IsInvitedForBattleGroundInstance(GetBattleGroundId()) ||
|
||||
currentBg->IsPlayerInBattleGround(GetGUID()))
|
||||
{
|
||||
currentBg->PlayerRelogin(this);
|
||||
if(currentBg->GetMapId() == GetMapId()) // we teleported/login to/in bg
|
||||
{
|
||||
uint32 team = currentBg->GetPlayerTeam(GetGUID());
|
||||
if(!team)
|
||||
team = GetTeam();
|
||||
Group* group = currentBg->GetBgRaid(team);
|
||||
if(!group) // first player joined
|
||||
{
|
||||
group = new Group;
|
||||
currentBg->SetBgRaid(team, group);
|
||||
group->Create(GetGUIDLow(), GetName());
|
||||
}
|
||||
else // raid already exist
|
||||
{
|
||||
if(group->IsMember(GetGUID()))
|
||||
{
|
||||
uint8 subgroup = group->GetMemberGroup(GetGUID());
|
||||
SetGroup(group, subgroup);
|
||||
}
|
||||
else
|
||||
currentBg->GetBgRaid(team)->AddMember(GetGUID(), GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SendAurasForTarget(this);
|
||||
SendEnchantmentDurations(); // must be after add to map
|
||||
SendItemDurations(); // must be after add to map
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7275"
|
||||
#define REVISION_NR "7276"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue