mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8007] Do not create empty maps while sending packets.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
This commit is contained in:
parent
68ee99f6ac
commit
6a5b6f08e0
3 changed files with 38 additions and 6 deletions
|
|
@ -5559,17 +5559,43 @@ void Player::SaveRecallPosition()
|
|||
|
||||
void Player::SendMessageToSet(WorldPacket *data, bool self)
|
||||
{
|
||||
GetMap()->MessageBroadcast(this, data, self);
|
||||
Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
|
||||
if(_map)
|
||||
{
|
||||
_map->MessageBroadcast(this, data, self);
|
||||
return;
|
||||
}
|
||||
|
||||
//if player is not in world and map in not created/already destroyed
|
||||
//no need to create one, just send packet for itself!
|
||||
if(self)
|
||||
GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self)
|
||||
{
|
||||
GetMap()->MessageDistBroadcast(this, data, dist, self);
|
||||
Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
|
||||
if(_map)
|
||||
{
|
||||
_map->MessageDistBroadcast(this, data, dist, self);
|
||||
return;
|
||||
}
|
||||
|
||||
if(self)
|
||||
GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool own_team_only)
|
||||
{
|
||||
GetMap()->MessageDistBroadcast(this, data, dist, self,own_team_only);
|
||||
Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
|
||||
if(_map)
|
||||
{
|
||||
_map->MessageDistBroadcast(this, data, dist, self, own_team_only);
|
||||
return;
|
||||
}
|
||||
|
||||
if(self)
|
||||
GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
void Player::SendDirectMessage(WorldPacket *data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue