diff options
author | Shauren <shauren.trinity@gmail.com> | 2015-09-28 17:20:27 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2015-09-28 17:20:27 +0200 |
commit | cd27fd38b93884797c094a82dc7beb0498e2f124 (patch) | |
tree | f4bb0ff6baf13e90bfb51697ceb3161253437d06 /src/server/game/Handlers/QueryHandler.cpp | |
parent | 3bc3b67a8fae059e1019446b09882dfa7fcd11a0 (diff) |
Core/Maps: Moved corpse management to map level
Diffstat (limited to 'src/server/game/Handlers/QueryHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/QueryHandler.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index a9ab4ca841d..93611114b4e 100644 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -169,9 +169,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPackets::Query::QueryGameObj void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLocationFromClient& /*packet*/) { - Corpse* corpse = GetPlayer()->GetCorpse(); - - if (!corpse) + if (!_player->HasCorpse()) { WorldPackets::Query::CorpseLocation packet; packet.Valid = false; // corpse not found @@ -179,11 +177,12 @@ void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLoc return; } - uint32 mapID = corpse->GetMapId(); - float x = corpse->GetPositionX(); - float y = corpse->GetPositionY(); - float z = corpse->GetPositionZ(); - uint32 corpseMapID = mapID; + WorldLocation corpseLocation = _player->GetCorpseLocation(); + uint32 corpseMapID = corpseLocation.GetMapId(); + uint32 mapID = corpseLocation.GetMapId(); + float x = corpseLocation.GetPositionX(); + float y = corpseLocation.GetPositionY(); + float z = corpseLocation.GetPositionZ(); // if corpse at different map if (mapID != _player->GetMapId()) @@ -210,7 +209,7 @@ void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLoc packet.MapID = corpseMapID; packet.ActualMapID = mapID; packet.Position = G3D::Vector3(x, y, z); - packet.Transport = corpse->GetTransGUID(); + packet.Transport = ObjectGuid::Empty; SendPacket(packet.Write()); } @@ -280,12 +279,12 @@ void WorldSession::HandleQueryPageText(WorldPackets::Query::QueryPageText& packe } } -void WorldSession::HandleQueryCorpseTransport(WorldPackets::Query::QueryCorpseTransport& packet) +void WorldSession::HandleQueryCorpseTransport(WorldPackets::Query::QueryCorpseTransport& queryCorpseTransport) { Corpse* corpse = _player->GetCorpse(); WorldPackets::Query::CorpseTransportQuery response; - if (!corpse || corpse->GetTransGUID().IsEmpty() || corpse->GetTransGUID() != packet.Transport) + if (!corpse || corpse->GetTransGUID().IsEmpty() || corpse->GetTransGUID() != queryCorpseTransport.Transport) { response.Position = G3D::Vector3(0.0f, 0.0f, 0.0f); response.Facing = 0.0f; |