diff options
author | megamage <none@none> | 2009-04-08 16:28:58 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-08 16:28:58 -0500 |
commit | f48b123ebe22624e48e6fda4a9a341e7354a93f7 (patch) | |
tree | 684e683f8e8bfa314869579fac206982919e9329 /src/game/BattleGroundHandler.cpp | |
parent | 5f3947b62a3d46117ba95d93fd27b6227c5869d6 (diff) |
[7630] Implement MSG_BATTLEGROUND_PLAYER_POSITIONS sending for AB and AV battleground. Author: Triply
--HG--
branch : trunk
Diffstat (limited to 'src/game/BattleGroundHandler.cpp')
-rw-r--r-- | src/game/BattleGroundHandler.cpp | 80 |
1 files changed, 51 insertions, 29 deletions
diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index f3be835e0f2..1fce92871c5 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -213,40 +213,62 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv if(!bg) // can't be received if player not in battleground return; - if(bg->GetTypeID() == BATTLEGROUND_WS) + switch( bg->GetTypeID() ) { - uint32 count1 = 0; - uint32 count2 = 0; + case BATTLEGROUND_WS: + { + uint32 count1 = 0; //always constant zero? + uint32 count2 = 0; //count of next fields - Player *ap = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID()); - if(ap) ++count2; + Player *ali_plr = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID()); + if( ali_plr ) + ++count2; - Player *hp = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID()); - if(hp) ++count2; + Player *horde_plr = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID()); + if( horde_plr ) + ++count2; - WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4+16*count1+16*count2)); - data << count1; // alliance flag holders count - /*for(uint8 i = 0; i < count1; i++) - { - data << uint64(0); // guid - data << (float)0; // x - data << (float)0; // y - }*/ - data << count2; // horde flag holders count - if(ap) - { - data << (uint64)ap->GetGUID(); - data << (float)ap->GetPositionX(); - data << (float)ap->GetPositionY(); - } - if(hp) - { - data << (uint64)hp->GetGUID(); - data << (float)hp->GetPositionX(); - data << (float)hp->GetPositionY(); - } + WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4+16*count1+16*count2)); + data << count1; // alliance flag holders count - obsolete, now always 0 + /*for(uint8 i = 0; i < count1; i++) + { + data << uint64(0); // guid + data << (float)0; // x + data << (float)0; // y + }*/ + data << count2; // horde flag holders count - obsolete, now count of next fields + if( ali_plr ) + { + data << (uint64)ali_plr->GetGUID(); + data << (float)ali_plr->GetPositionX(); + data << (float)ali_plr->GetPositionY(); + } + if( horde_plr ) + { + data << (uint64)horde_plr->GetGUID(); + data << (float)horde_plr->GetPositionX(); + data << (float)horde_plr->GetPositionY(); + } - SendPacket(&data); + SendPacket(&data); + } + break; + case BATTLEGROUND_EY: + //TODO : fix me! + break; + case BATTLEGROUND_AB: + case BATTLEGROUND_AV: + { + //for other BG types - send default + WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4)); + data << uint32(0); + data << uint32(0); + SendPacket(&data); + } + break; + default: + //maybe it is sent also in arena - do nothing + break; } } |