mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[7255] Allows saving characters in Battle Grounds.
* Now player can join to BG after logout during 5 minutes, if BG in progress. * All players after server crash or restart should appear at the battlemaster Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
8af53064eb
commit
75121a5823
11 changed files with 162 additions and 52 deletions
|
|
@ -130,31 +130,23 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||
if(!mEntry->IsMountAllowed())
|
||||
_player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
|
||||
|
||||
// battleground state prepare
|
||||
// battleground state prepare (in case join to BG), at relogin/tele player not invited
|
||||
// only add to bg group and object, if the player was invited (else he entered through command)
|
||||
if(_player->InBattleGround() && _player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId()))
|
||||
if(_player->InBattleGround())
|
||||
{
|
||||
BattleGround *bg = _player->GetBattleGround();
|
||||
if(bg)
|
||||
// cleanup seting if outdated
|
||||
if(!mEntry->IsBattleGroundOrArena())
|
||||
{
|
||||
bg->AddPlayer(_player);
|
||||
if(bg->GetMapId() == _player->GetMapId()) // we teleported to bg
|
||||
{
|
||||
// get the team this way, because arenas might 'override' the teams.
|
||||
uint32 team = bg->GetPlayerTeam(_player->GetGUID());
|
||||
if(!team)
|
||||
team = _player->GetTeam();
|
||||
if(!bg->GetBgRaid(team)) // first player joined
|
||||
{
|
||||
Group *group = new Group;
|
||||
bg->SetBgRaid(team, group);
|
||||
group->Create(_player->GetGUIDLow(), _player->GetName());
|
||||
}
|
||||
else // raid already exist
|
||||
{
|
||||
bg->GetBgRaid(team)->AddMember(_player->GetGUID(), _player->GetName());
|
||||
}
|
||||
}
|
||||
// Do next only if found in battleground
|
||||
_player->SetBattleGroundId(0); // We're not in BG.
|
||||
// reset destination bg team
|
||||
_player->SetBGTeam(0);
|
||||
}
|
||||
// join to bg case
|
||||
else if(BattleGround *bg = _player->GetBattleGround())
|
||||
{
|
||||
if(_player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId()))
|
||||
bg->AddPlayer(_player);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue