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
|
|
@ -1550,12 +1550,18 @@ void WorldObject::BuildTeleportAckMsg(WorldPacket *data, float x, float y, float
|
||||||
|
|
||||||
void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/)
|
void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/)
|
||||||
{
|
{
|
||||||
GetMap()->MessageBroadcast(this, data);
|
//if object is in world, map for it already created!
|
||||||
|
Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
|
||||||
|
if(_map)
|
||||||
|
_map->MessageBroadcast(this, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/)
|
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/)
|
||||||
{
|
{
|
||||||
GetMap()->MessageDistBroadcast(this, data, dist);
|
//if object is in world, map for it already created!
|
||||||
|
Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
|
||||||
|
if(_map)
|
||||||
|
_map->MessageDistBroadcast(this, data, dist);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
|
void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
|
||||||
|
|
|
||||||
|
|
@ -5559,17 +5559,43 @@ void Player::SaveRecallPosition()
|
||||||
|
|
||||||
void Player::SendMessageToSet(WorldPacket *data, bool self)
|
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)
|
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)
|
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)
|
void Player::SendDirectMessage(WorldPacket *data)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8006"
|
#define REVISION_NR "8007"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue