@@ -337,13 +337,13 @@ namespace
337
337
338
338
// helper function for forEachInternal
339
339
template <class Visitor , class List >
340
- bool forEachImp (Visitor& visitor, List& list, MWWorld::CellStore* cellStore)
340
+ bool forEachImp (Visitor& visitor, List& list, MWWorld::CellStore& cellStore, bool includeDeleted )
341
341
{
342
- for (typename List::List::iterator iter ( list.mList . begin ()); iter != list. mList . end (); ++iter )
342
+ for (auto & v : list.mList )
343
343
{
344
- if (!MWWorld::CellStore::isAccessible (iter-> mData , iter-> mRef ))
344
+ if (!includeDeleted && ! MWWorld::CellStore::isAccessible (v. mData , v. mRef ))
345
345
continue ;
346
- if (!visitor (MWWorld::Ptr (&*iter, cellStore)))
346
+ if (!visitor (MWWorld::Ptr (&v, & cellStore)))
347
347
return false ;
348
348
}
349
349
return true ;
@@ -399,12 +399,12 @@ namespace MWWorld
399
399
// listing only objects owned by this cell. Internal use only, you probably want to use forEach() so that moved
400
400
// objects are accounted for.
401
401
template <class Visitor >
402
- static bool forEachInternal (Visitor& visitor, MWWorld::CellStore& cellStore)
402
+ static bool forEachInternal (Visitor& visitor, MWWorld::CellStore& cellStore, bool includeDeleted )
403
403
{
404
404
bool returnValue = true ;
405
405
406
- Misc::tupleForEach (cellStore.mCellStoreImp ->mRefLists , [&visitor, &returnValue, &cellStore ](auto & store) {
407
- returnValue = returnValue && forEachImp (visitor, store, & cellStore);
406
+ Misc::tupleForEach (cellStore.mCellStoreImp ->mRefLists , [&](auto & store) {
407
+ returnValue = returnValue && forEachImp (visitor, store, cellStore, includeDeleted );
408
408
});
409
409
410
410
return returnValue;
@@ -583,11 +583,11 @@ namespace MWWorld
583
583
mMergedRefsNeedsUpdate = true ;
584
584
}
585
585
586
- void CellStore::updateMergedRefs () const
586
+ void CellStore::updateMergedRefs (bool includeDeleted ) const
587
587
{
588
588
mMergedRefs .clear ();
589
589
MergeVisitor visitor (mMergedRefs , mMovedHere , mMovedToAnotherCell );
590
- CellStoreImp::forEachInternal (visitor, const_cast <CellStore&>(*this ));
590
+ CellStoreImp::forEachInternal (visitor, const_cast <CellStore&>(*this ), includeDeleted );
591
591
visitor.merge ();
592
592
mMergedRefsNeedsUpdate = false ;
593
593
}
0 commit comments