mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7961] Use more fast code into HandleCorpseQueryOpcode.
Also small changes in send data (if corpse exist data send always).
This commit is contained in:
parent
5b02b07156
commit
ddda332ca6
2 changed files with 17 additions and 13 deletions
|
|
@ -287,21 +287,25 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
|
||||||
float x = corpse->GetPositionX();
|
float x = corpse->GetPositionX();
|
||||||
float y = corpse->GetPositionY();
|
float y = corpse->GetPositionY();
|
||||||
float z = corpse->GetPositionZ();
|
float z = corpse->GetPositionZ();
|
||||||
int32 corpsemapid = _player->GetMapId();
|
int32 corpsemapid = mapid;
|
||||||
|
|
||||||
if(Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()))
|
// if corpse at different map
|
||||||
|
if(mapid != _player->GetMapId())
|
||||||
{
|
{
|
||||||
if(map->IsDungeon())
|
// search entrance map for proper show entrance
|
||||||
|
if(MapEntry const* corpseMapEntry = sMapStore.LookupEntry(mapid))
|
||||||
{
|
{
|
||||||
if(!map->GetEntrancePos(mapid, x, y))
|
if(corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0)
|
||||||
return;
|
{
|
||||||
|
// if corpse map have entrance
|
||||||
Map *entrance_map = MapManager::Instance().GetMap(mapid, _player);
|
if(Map const* entranceMap = MapManager::Instance().GetBaseMap(corpseMapEntry->entrance_map))
|
||||||
if(!entrance_map)
|
{
|
||||||
return;
|
mapid = corpseMapEntry->entrance_map;
|
||||||
|
x = corpseMapEntry->entrance_x;
|
||||||
z = entrance_map->GetHeight(x, y, MAX_HEIGHT);
|
y = corpseMapEntry->entrance_y;
|
||||||
corpsemapid = corpse->GetMapId();
|
z = entranceMap->GetHeight(x, y, MAX_HEIGHT);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7960"
|
#define REVISION_NR "7961"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue