Let ServerPacket Handle the writting of packet data.

This commit is contained in:
hondacrx
2017-07-06 11:01:31 -04:00
parent a6b30c73e4
commit 210a2958ff
18 changed files with 73 additions and 80 deletions
+1 -2
View File
@@ -1401,13 +1401,12 @@ namespace Game
public bool SendZoneMessage(uint zone, ServerPacket packet, WorldSession self = null, uint team = 0)
{
bool foundPlayerToSend = false;
packet.Write();
foreach (var session in m_sessions.Values)
{
if (session != null && session.GetPlayer() && session.GetPlayer().IsInWorld &&
session.GetPlayer().GetZoneId() == zone && session != self && (team == 0 || (uint)session.GetPlayer().GetTeam() == team))
{
session.SendPacket(packet, false);
session.SendPacket(packet);
foundPlayerToSend = true;
}
}