mirror of
https://github.com/mangosfour/server.git
synced 2025-12-22 22:37:06 +00:00
[7416] Fixed minimap icon for battlegrounds and arenas. Patch provided by Balrok. Thx.
Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
parent
bd0619ce40
commit
18c8e861f4
5 changed files with 24 additions and 35 deletions
|
|
@ -296,7 +296,7 @@ void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
|||
plr2->RemoveBattleGroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to
|
||||
// queue->removeplayer, it causes bugs
|
||||
WorldPacket data;
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, plr2->GetTeam(), queueSlot, STATUS_NONE, 0, 0);
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0);
|
||||
plr2->GetSession()->SendPacket(&data);
|
||||
}
|
||||
// then actually delete, this may delete the group as well!
|
||||
|
|
@ -396,7 +396,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b
|
|||
sLog.outDebug("Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID());
|
||||
|
||||
// send status packet
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, side?side:plr->GetTeam(), queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0);
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0);
|
||||
plr->GetSession()->SendPacket(&data);
|
||||
}
|
||||
return true;
|
||||
|
|
@ -428,7 +428,6 @@ void BattleGroundQueue::BGEndedRemoveInvites(BattleGround *bg)
|
|||
{
|
||||
// after removing this much playerinfos, the ginfo will be deleted, so we'll use a for loop
|
||||
uint32 to_remove = ginfo->Players.size();
|
||||
uint32 team = ginfo->Team;
|
||||
for(uint32 j = 0; j < to_remove; j++)
|
||||
{
|
||||
// always remove the first one in the group
|
||||
|
|
@ -454,7 +453,7 @@ void BattleGroundQueue::BGEndedRemoveInvites(BattleGround *bg)
|
|||
// remove player from queue, this might delete the ginfo as well! don't use that pointer after this!
|
||||
RemovePlayer(itr2->first, true);
|
||||
WorldPacket data;
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, team, queueSlot, STATUS_NONE, 0, 0);
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0);
|
||||
plr->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
|
@ -1013,7 +1012,7 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
|||
if (qItr != qpMap.end() && qItr->second.GroupInfo->IsInvitedToBGInstanceGUID == m_BgInstanceGUID)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, qItr->second.GroupInfo->Team, queueSlot, STATUS_WAIT_JOIN, INVITATION_REMIND_TIME, 0);
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITATION_REMIND_TIME, 0);
|
||||
plr->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
|
@ -1052,7 +1051,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
|||
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].RemovePlayer(m_PlayerGuid, true);
|
||||
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bg->GetTypeID(), bg->GetQueueId());
|
||||
WorldPacket data;
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, m_PlayersTeam, queueSlot, STATUS_NONE, 0, 0);
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0);
|
||||
plr->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
|
@ -1168,7 +1167,7 @@ void BattleGroundMgr::Update(uint32 diff)
|
|||
}
|
||||
}
|
||||
|
||||
void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint32 team, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint32 arenatype, uint8 israted)
|
||||
void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint32 arenatype)
|
||||
{
|
||||
// we can be in 3 queues in same time...
|
||||
if(StatusID == 0)
|
||||
|
|
@ -1185,7 +1184,8 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro
|
|||
*data << uint64( uint64(arenatype ? arenatype : bg->GetArenaType()) | (uint64(0x0D) << 8) | (uint64(bg->GetTypeID()) << 16) | (uint64(0x1F90) << 48) );
|
||||
*data << uint32(0); // unknown
|
||||
// alliance/horde for BG and skirmish/rated for Arenas
|
||||
*data << uint8(bg->isArena() ? ( israted ? israted : bg->isRated() ) : bg->GetTeamIndexByTeamId(team));
|
||||
// following displays the minimap-icon 0 = faction icon 1 = arenaicon
|
||||
*data << uint8(bg->isArena());
|
||||
/* *data << uint8(arenatype ? arenatype : bg->GetArenaType()); // team type (0=BG, 2=2x2, 3=3x3, 5=5x5), for arenas // NOT PROPER VALUE IF ARENA ISN'T RUNNING YET!!!!
|
||||
switch(bg->GetTypeID()) // value depends on bg id
|
||||
{
|
||||
|
|
@ -1235,10 +1235,7 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro
|
|||
*data << uint16(0x1F90); // unk value 8080
|
||||
*data << uint32(bg->GetInstanceID()); // instance id
|
||||
|
||||
if(bg->isBattleGround())
|
||||
*data << uint8(bg->GetTeamIndexByTeamId(team)); // team
|
||||
else
|
||||
*data << uint8(israted?israted:bg->isRated()); // is rated battle
|
||||
*data << uint8(bg->isArena()); // minimap-icon 0=faction 1=arena
|
||||
*/
|
||||
*data << uint32(StatusID); // status
|
||||
switch(StatusID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue