mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
Fixed arena matches for same faction (players were all in one group - and they couldn't attack each other)
This commit is contained in:
parent
b75157946c
commit
7c67848b48
1 changed files with 22 additions and 20 deletions
|
|
@ -86,6 +86,28 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//this will set player's team ... so IT MUST BE CALLED BEFORE SendInitialPacketsAfterAddToMap()
|
||||
// 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())
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
// join to bg case
|
||||
else if(BattleGround *bg = _player->GetBattleGround())
|
||||
{
|
||||
if(_player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId()))
|
||||
bg->AddPlayer(_player);
|
||||
}
|
||||
}
|
||||
|
||||
GetPlayer()->SendInitialPacketsAfterAddToMap();
|
||||
|
||||
// flight fast teleport case
|
||||
|
|
@ -130,26 +152,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||
if(!mEntry->IsMountAllowed())
|
||||
_player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
|
||||
|
||||
// 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())
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
// join to bg case
|
||||
else if(BattleGround *bg = _player->GetBattleGround())
|
||||
{
|
||||
if(_player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId()))
|
||||
bg->AddPlayer(_player);
|
||||
}
|
||||
}
|
||||
|
||||
// honorless target
|
||||
if(GetPlayer()->pvpInfo.inHostileArea)
|
||||
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue