[Client] Also include list of creatures in reply to ActorList

0.6.1
David Cernat 8 years ago
parent ca92be14a5
commit bb9ea6ccd4

@ -51,12 +51,27 @@ void WorldEvent::sendActors(MWWorld::CellStore* cellStore)
for (typename MWWorld::CellRefList<ESM::NPC>::List::iterator listIter(npcList->mList.begin());
listIter != npcList->mList.end(); ++listIter)
{
MWWorld::Ptr npc(&*listIter, 0);
MWWorld::Ptr ptr(&*listIter, 0);
mwmp::WorldObject worldObject;
worldObject.refId = npc.getCellRef().getRefId();
worldObject.refNumIndex = npc.getCellRef().getRefNum().mIndex;
worldObject.mpNum = npc.getCellRef().getMpNum();
worldObject.refId = ptr.getCellRef().getRefId();
worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex;
worldObject.mpNum = ptr.getCellRef().getMpNum();
worldEvent->addObject(worldObject);
}
MWWorld::CellRefList<ESM::Creature> *creatureList = cellStore->getCreatures();
for (typename MWWorld::CellRefList<ESM::Creature>::List::iterator listIter(creatureList->mList.begin());
listIter != creatureList->mList.end(); ++listIter)
{
MWWorld::Ptr ptr(&*listIter, 0);
mwmp::WorldObject worldObject;
worldObject.refId = ptr.getCellRef().getRefId();
worldObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex;
worldObject.mpNum = ptr.getCellRef().getMpNum();
worldEvent->addObject(worldObject);
}

@ -487,6 +487,12 @@ namespace MWWorld
return &mNpcs;
}
// Added by tes3mp and used to get all the creatures in the cell
CellRefList<ESM::Creature> *CellStore::getCreatures()
{
return &mCreatures;
}
// Added by tes3mp and used to get all the containers in the cell
CellRefList<ESM::Container> *CellStore::getContainers()
{

@ -240,6 +240,9 @@ namespace MWWorld
CellRefList<ESM::NPC> *getNpcs();
// Added by tes3mp and used to get all the NPCs in the cell
CellRefList<ESM::Creature> *getCreatures();
// Added by tes3mp and used to get all the creatures in the cell
CellRefList<ESM::Container> *getContainers();
// Added by tes3mp and used to get all the containers in the cell

Loading…
Cancel
Save