@@ -271,14 +271,17 @@ void CClientStreamer::SetDimension(unsigned short usDimension)
271271 if (!pSector)
272272 continue ;
273273
274- // Process directly without making a full copy
274+ std::vector<CClientStreamElement*> tempElements;
275+
275276 for (auto iter = pSector->Begin (); iter != pSector->End (); ++iter)
276277 {
277278 CClientStreamElement* pElement = *iter;
278- if (!pElement)
279- continue ;
279+ if (pElement)
280+ tempElements.push_back (pElement);
281+ }
280282
281- // Should this element be hidden in the new dimension?
283+ for (CClientStreamElement* pElement : tempElements)
284+ {
282285 if (!IsElementShouldVisibleInCurrentDimension (pElement))
283286 elementsToHide.push_back (pElement);
284287 }
@@ -565,7 +568,7 @@ void CClientStreamer::AddToSortedList(std::list<CClientStreamElement*>* pList, C
565568 continue ;
566569
567570 // Is it further than the one we add?
568- if (pTemp->GetDistanceToBoundingBoxSquared (m_vecPosition ) > fDistance )
571+ if (pTemp->GetExpDistance ( ) > fDistance )
569572 {
570573 // Add it before here
571574 pList->insert (iter, pElement);
@@ -1024,7 +1027,7 @@ void CClientStreamer::OnElementDimension(CClientStreamElement* pElement)
10241027void CClientStreamer::SetStreamerLimits (int normalIn, int normalOut, int farIn, int farOut)
10251028{
10261029 if ((normalIn) < (STREAMER_MAX_IN_DEFAULT / 2 ) || (normalOut) < (STREAMER_MAX_OUT_DEFAULT / 2 ) || (farIn) < (STREAMER_MAX_IN_FAR / 2 ) ||
1027- (farOut) < (STREAMER_MAX_OUT_FAR / 2 )) // Block too low limits to avoid issues
1030+ (farOut) < (STREAMER_MAX_OUT_FAR / 2 ))
10281031 {
10291032 throw std::invalid_argument (" Invalid streamer limits" );
10301033 }
0 commit comments