aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-13 19:56:55 -0600
committermegamage <none@none>2009-02-13 19:56:55 -0600
commitc58050252dfd0eae4b2701f4c0b62d259d1d4025 (patch)
treed01a9d1dc82b743a2131b449ae80c23051d22771 /src
parent8eb1f455a101df2316e75f247a3c96d7debbbc36 (diff)
Fixed arena matches for same faction (players were all in one group - and they couldn't attack each other) Author: Triply
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/MovementHandler.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp
index 4e4dff56a47..aae26b5c5c1 100644
--- a/src/game/MovementHandler.cpp
+++ b/src/game/MovementHandler.cpp
@@ -88,6 +88,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
@@ -132,26 +154,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);