From 7918e887dde7b164eb29530953a47bc7c1de2d03 Mon Sep 17 00:00:00 2001 From: Koncord Date: Tue, 27 Jun 2017 21:56:14 +0800 Subject: [PATCH] [Client] Update ActorList to C++11 --- apps/openmw/mwmp/ActorList.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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;