mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-19 14:29:33 -04:00
Merge pull request #5377 from kandera/wintergrasp_cleanup
Wintergrasp cleanup
This commit is contained in:
@@ -103,17 +103,9 @@ void Battlefield::HandlePlayerLeaveZone(Player *plr, uint32 /*zone */ )
|
||||
{
|
||||
m_PlayersInWar[plr->GetTeamId()].erase(plr->GetGUID());
|
||||
plr->GetSession()->SendBfLeaveMessage(m_BattleId);
|
||||
if (Group* group = GetGroupPlayer(plr->GetGUID(), plr->GetTeamId())) // remove from raid group if player is member
|
||||
{
|
||||
// I think that now is not a hack
|
||||
if (!group->RemoveMember(plr->GetGUID())) // group was disbanded
|
||||
{
|
||||
m_Groups[plr->GetTeamId()].erase(group->GetGUID());
|
||||
group->SetBattlefieldGroup(NULL);
|
||||
sGroupMgr->RemoveGroup(group);
|
||||
delete group;
|
||||
}
|
||||
}
|
||||
if (Group* group = plr->GetGroup()) // remove from raid group if player is member
|
||||
group->RemoveMember(plr->GetGUID());
|
||||
|
||||
OnPlayerLeaveWar(plr); //For scripting
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,11 +84,11 @@ void WorldSession::SendBfEntered(uint32 BattleId)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendBfLeaveMessage(uint32 BattleId, uint8 reason)
|
||||
void WorldSession::SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason)
|
||||
{
|
||||
WorldPacket data(SMSG_BATTLEFIELD_MGR_EJECTED, 7);
|
||||
data << uint32(BattleId);
|
||||
data << uint8(reason);//byte Reason (1=close invite,8="exited",10="to low level")
|
||||
data << uint8(reason);//byte Reason
|
||||
data << uint8(2);//byte BattleStatus
|
||||
data << uint8(0);//bool Relocated
|
||||
SendPacket(&data);
|
||||
|
||||
@@ -123,6 +123,16 @@ enum PartyResult
|
||||
ERR_PARTY_LFG_TELEPORT_IN_COMBAT = 30
|
||||
};
|
||||
|
||||
|
||||
enum BFLeaveReason
|
||||
{
|
||||
BF_LEAVE_REASON_CLOSE = 0x00000001,
|
||||
//BF_LEAVE_REASON_UNK1 = 0x00000002, (not used)
|
||||
//BF_LEAVE_REASON_UNK2 = 0x00000004, (not used)
|
||||
BF_LEAVE_REASON_EXITED = 0x00000008,
|
||||
BF_LEAVE_REASON_LOW_LEVEL = 0x00000010,
|
||||
};
|
||||
|
||||
enum ChatRestrictionType
|
||||
{
|
||||
ERR_CHAT_RESTRICTED = 0,
|
||||
@@ -789,7 +799,7 @@ class WorldSession
|
||||
void SendBfInvitePlayerToQueue(uint32 BattleId);
|
||||
void SendBfQueueInviteResponce(uint32 BattleId,uint32 ZoneId, bool CanQueue = true, bool Full = false);
|
||||
void SendBfEntered(uint32 BattleId);
|
||||
void SendBfLeaveMessage(uint32 BattleId, uint8 reason = 8);
|
||||
void SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED);
|
||||
void HandleBfQueueInviteResponse(WorldPacket &recv_data);
|
||||
void HandleBfEntryInviteResponse(WorldPacket &recv_data);
|
||||
void HandleBfExitRequest(WorldPacket &recv_data);
|
||||
|
||||
Reference in New Issue
Block a user