本文整理汇总了C++中Corpse::AddToWorld方法的典型用法代码示例。如果您正苦于以下问题:C++ Corpse::AddToWorld方法的具体用法?C++ Corpse::AddToWorld怎么用?C++ Corpse::AddToWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Corpse
的用法示例。
在下文中一共展示了Corpse::AddToWorld方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadHelper
void LoadHelper(CellCorpseSet const& cell_corpses, CellCoord& cell, CorpseMapType& m, uint32& count, Map* map)
{
if (cell_corpses.empty())
return;
for (CellCorpseSet::const_iterator itr = cell_corpses.begin(); itr != cell_corpses.end(); ++itr)
{
if (itr->second != map->GetInstanceId())
continue;
uint32 player_guid = itr->first;
Corpse* obj = ObjectAccessor::Instance().GetCorpseForPlayerGUID(player_guid);
if (!obj)
continue;
// @todo this is a hack
// corpse's map should be reset when the map is unloaded
// but it may still exist when the grid is unloaded but map is not
// in that case map == currMap
obj->SetMap(map);
if (obj->IsInGrid())
{
obj->AddToWorld();
continue;
}
AddObjectHelper(cell, m, count, map, obj);
}
}
示例2: LoadHelper
void LoadHelper(CellCorpseSet const& cell_corpses, CellPair& cell, CorpseMapType& /*m*/, uint32& count, Map* map, GridType& grid)
{
if (cell_corpses.empty())
return;
for (CellCorpseSet::const_iterator itr = cell_corpses.begin(); itr != cell_corpses.end(); ++itr)
{
if (itr->second != map->GetInstanceId())
continue;
uint32 player_lowguid = itr->first;
Corpse* obj = sObjectAccessor.GetCorpseForPlayerGUID(ObjectGuid(HIGHGUID_PLAYER, player_lowguid));
if (!obj)
continue;
grid.AddWorldObject(obj);
addUnitState(obj, cell);
obj->SetMap(map);
obj->AddToWorld();
if (obj->isActiveObject())
map->AddToActive(obj);
++count;
}
}