mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
Fixed MSG_CORPSE_QUERY for dungeons/raids, fixed SMSG_ATTACKERSTATEUPDATE
This commit is contained in:
parent
8a29415450
commit
5ca92eddd7
9 changed files with 96 additions and 48 deletions
|
|
@ -31,6 +31,7 @@
|
|||
#include "NPCHandler.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Pet.h"
|
||||
#include "MapManager.h"
|
||||
|
||||
void WorldSession::SendNameQueryOpcode(Player *p)
|
||||
{
|
||||
|
|
@ -272,19 +273,42 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
|
|||
|
||||
Corpse *corpse = GetPlayer()->GetCorpse();
|
||||
|
||||
uint8 found = 1;
|
||||
if(!corpse)
|
||||
found = 0;
|
||||
uint8 found = corpse ? 1 : 0;
|
||||
|
||||
int32 mapid = corpse->GetMapId();
|
||||
float x = corpse->GetPositionX();
|
||||
float y = corpse->GetPositionY();
|
||||
float z = corpse->GetPositionZ();
|
||||
int32 corpsemapid = _player->GetMapId();
|
||||
|
||||
if(found)
|
||||
{
|
||||
if(Map *map = corpse->GetMap())
|
||||
{
|
||||
if(map->IsDungeon())
|
||||
{
|
||||
if(!map->GetEntrancePos(mapid, x, y))
|
||||
return;
|
||||
|
||||
Map *entrance_map = MapManager::Instance().GetMap(mapid, _player);
|
||||
if(!entrance_map)
|
||||
return;
|
||||
|
||||
z = entrance_map->GetHeight(x, y, MAX_HEIGHT);
|
||||
corpsemapid = corpse->GetMapId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WorldPacket data(MSG_CORPSE_QUERY, (1+found*(5*4)));
|
||||
data << uint8(found);
|
||||
if(found)
|
||||
{
|
||||
data << corpse->GetMapId();
|
||||
data << corpse->GetPositionX();
|
||||
data << corpse->GetPositionY();
|
||||
data << corpse->GetPositionZ();
|
||||
data << _player->GetMapId();
|
||||
data << int32(mapid);
|
||||
data << float(x);
|
||||
data << float(y);
|
||||
data << float(z);
|
||||
data << int32(corpsemapid);
|
||||
}
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue