diff --git a/apps/openmw/mwmp/ActorList.cpp b/apps/openmw/mwmp/ActorList.cpp index f83b79230..33b899d30 100644 --- a/apps/openmw/mwmp/ActorList.cpp +++ b/apps/openmw/mwmp/ActorList.cpp @@ -174,12 +174,9 @@ void ActorList::sendActorsInCell(MWWorld::CellStore* cellStore) cell = *cellStore->getCell(); action = BaseActorList::SET; - MWWorld::CellRefList *npcList = cellStore->getNpcs(); - - for (typename MWWorld::CellRefList::List::iterator listIter(npcList->mList.begin()); - listIter != npcList->mList.end(); ++listIter) + for(auto &ref : cellStore->getNpcs()->mList) { - MWWorld::Ptr ptr(&*listIter, 0); + MWWorld::Ptr ptr(&ref, 0); // If this Ptr is lacking a unique index, ignore it if (ptr.getCellRef().getRefNum().mIndex == 0 && ptr.getCellRef().getMpNum() == 0) continue; @@ -192,12 +189,9 @@ void ActorList::sendActorsInCell(MWWorld::CellStore* cellStore) addActor(actor); } - MWWorld::CellRefList *creatureList = cellStore->getCreatures(); - - for (typename MWWorld::CellRefList::List::iterator listIter(creatureList->mList.begin()); - listIter != creatureList->mList.end(); ++listIter) + for(auto &ref : cellStore->getCreatures()->mList) { - MWWorld::Ptr ptr(&*listIter, 0); + MWWorld::Ptr ptr(&ref, 0); // If this Ptr is lacking a unique index, ignore it if (ptr.getCellRef().getRefNum().mIndex == 0 && ptr.getCellRef().getMpNum() == 0) continue;