本文整理汇总了C++中Corpse::GetTransGUID方法的典型用法代码示例。如果您正苦于以下问题:C++ Corpse::GetTransGUID方法的具体用法?C++ Corpse::GetTransGUID怎么用?C++ Corpse::GetTransGUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Corpse
的用法示例。
在下文中一共展示了Corpse::GetTransGUID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleQueryCorpseTransport
void WorldSession::HandleQueryCorpseTransport(WorldPackets::Query::QueryCorpseTransport& packet)
{
TC_LOG_DEBUG("network", "WORLD: Recv CMSG_QUERY_CORPSE_TRANSPORT");
Corpse* corpse = _player->GetCorpse();
WorldPackets::Query::CorpseTransportQuery response;
if (!corpse || corpse->GetTransGUID().IsEmpty() || corpse->GetTransGUID() != packet.Transport)
{
response.Position = G3D::Vector3(0.0f, 0.0f, 0.0f);
response.Facing = 0.0f;
}
else
{
response.Position = G3D::Vector3(corpse->GetTransOffsetX(), corpse->GetTransOffsetY(), corpse->GetTransOffsetZ());
response.Facing = corpse->GetTransOffsetO();
}
SendPacket(response.Write());
}
示例2: HandleQueryCorpseLocation
void WorldSession::HandleQueryCorpseLocation(WorldPackets::Query::QueryCorpseLocationFromClient& /*packet*/)
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUERY_CORPSE_LOCATION_FROM_CLIENT");
Corpse* corpse = GetPlayer()->GetCorpse();
if (!corpse)
{
WorldPackets::Query::CorpseLocation packet;
packet.Valid = false; // corpse not found
SendPacket(packet.Write());
return;
}
uint32 mapID = corpse->GetMapId();
float x = corpse->GetPositionX();
float y = corpse->GetPositionY();
float z = corpse->GetPositionZ();
uint32 corpseMapID = mapID;
// if corpse at different map
if (mapID != _player->GetMapId())
{
// search entrance map for proper show entrance
if (MapEntry const* corpseMapEntry = sMapStore.LookupEntry(mapID))
{
if (corpseMapEntry->IsDungeon() && corpseMapEntry->CorpseMapID >= 0)
{
// if corpse map have entrance
if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->CorpseMapID))
{
mapID = corpseMapEntry->CorpseMapID;
x = corpseMapEntry->CorpsePos.X;
y = corpseMapEntry->CorpsePos.Y;
z = entranceMap->GetHeight(GetPlayer()->GetPhaseMask(), x, y, MAX_HEIGHT);
}
}
}
}
WorldPackets::Query::CorpseLocation packet;
packet.Valid = true;
packet.MapID = corpseMapID;
packet.ActualMapID = mapID;
packet.Position = G3D::Vector3(x, y, z);
packet.Transport = corpse->GetTransGUID();
SendPacket(packet.Write());
}