Skip to content

Commit 53333b0

Browse files
committed
Remove useless check
1 parent 27f9ef5 commit 53333b0

File tree

1 file changed

+48
-52
lines changed

1 file changed

+48
-52
lines changed

Client/mods/deathmatch/logic/CClientStreamer.cpp

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -502,71 +502,67 @@ void CClientStreamer::Restream(bool bMovedFar)
502502
}
503503
else
504504
{
505-
// Same dimension as us?
506-
if (pElement->GetDimension() == m_usDimension || pElement->IsVisibleInAllDimensions())
507-
{
508-
// Too far away? Stop here.
509-
if (fElementDistanceExp > m_fMaxDistanceExp)
510-
continue;
505+
// Too far away? Stop here.
506+
if (fElementDistanceExp > m_fMaxDistanceExp)
507+
continue;
511508

512-
if (IS_VEHICLE(pElement))
513-
{
514-
CClientVehicle* pVehicle = DynamicCast<CClientVehicle>(pElement);
515-
if (pVehicle && pVehicle->GetOccupant() && IS_PLAYER(pVehicle->GetOccupant()))
516-
{
517-
CClientPlayer* pPlayer = DynamicCast<CClientPlayer>(pVehicle->GetOccupant());
518-
if (pPlayer->GetLastPuresyncType() == PURESYNC_TYPE_LIGHTSYNC)
519-
{
520-
// if the last packet was ls he isn't streaming in soon.
521-
continue;
522-
}
523-
}
524-
525-
if (pVehicle && pVehicle->GetTowedByVehicle())
526-
{
527-
// Streaming in of towed vehicles is done in CClientVehicle::StreamIn by the towing vehicle
528-
continue;
529-
}
530-
}
531-
if (IS_PLAYER(pElement))
509+
if (IS_VEHICLE(pElement))
510+
{
511+
CClientVehicle* pVehicle = DynamicCast<CClientVehicle>(pElement);
512+
if (pVehicle && pVehicle->GetOccupant() && IS_PLAYER(pVehicle->GetOccupant()))
532513
{
533-
CClientPlayer* pPlayer = DynamicCast<CClientPlayer>(pElement);
514+
CClientPlayer* pPlayer = DynamicCast<CClientPlayer>(pVehicle->GetOccupant());
534515
if (pPlayer->GetLastPuresyncType() == PURESYNC_TYPE_LIGHTSYNC)
535516
{
536517
// if the last packet was ls he isn't streaming in soon.
537518
continue;
538519
}
539520
}
540-
// If attached and attached-to is streamed out, don't consider for streaming in
541-
CClientStreamElement* pAttachedTo = DynamicCast<CClientStreamElement>(pElement->GetAttachedTo());
542-
if (pAttachedTo && !pAttachedTo->IsStreamedIn())
543-
{
544-
// ...unless attached to low LOD version
545-
CClientObject* pAttachedToObject = DynamicCast<CClientObject>(pAttachedTo);
546-
CClientObject* pObject = DynamicCast<CClientObject>(pElement);
547-
if (!pObject || !pAttachedToObject || pObject->IsLowLod() == pAttachedToObject->IsLowLod())
548-
continue;
549-
}
550521

551-
// Not room to stream in more elements?
552-
if (bReachedLimit)
522+
if (pVehicle && pVehicle->GetTowedByVehicle())
553523
{
554-
// Add to the list that might be streamed in during the final phase
555-
if ((int)ClosestStreamedOutList.size() < iMaxIn) // (only add if there is a chance it will be used)
556-
ClosestStreamedOutList.push_back(pElement);
524+
// Streaming in of towed vehicles is done in CClientVehicle::StreamIn by the towing vehicle
525+
continue;
557526
}
558-
else
527+
}
528+
if (IS_PLAYER(pElement))
529+
{
530+
CClientPlayer* pPlayer = DynamicCast<CClientPlayer>(pElement);
531+
if (pPlayer->GetLastPuresyncType() == PURESYNC_TYPE_LIGHTSYNC)
559532
{
560-
// Stream in the new element. Don't do it instantly unless moved from far away.
561-
pElement->InternalStreamIn(bMovedFar);
562-
bReachedLimit = ReachedLimit();
533+
// if the last packet was ls he isn't streaming in soon.
534+
continue;
535+
}
536+
}
537+
// If attached and attached-to is streamed out, don't consider for streaming in
538+
CClientStreamElement* pAttachedTo = DynamicCast<CClientStreamElement>(pElement->GetAttachedTo());
539+
if (pAttachedTo && !pAttachedTo->IsStreamedIn())
540+
{
541+
// ...unless attached to low LOD version
542+
CClientObject* pAttachedToObject = DynamicCast<CClientObject>(pAttachedTo);
543+
CClientObject* pObject = DynamicCast<CClientObject>(pElement);
544+
if (!pObject || !pAttachedToObject || pObject->IsLowLod() == pAttachedToObject->IsLowLod())
545+
continue;
546+
}
563547

564-
if (!bReachedLimit)
565-
{
566-
iMaxIn--;
567-
if (iMaxIn <= 0)
568-
break;
569-
}
548+
// Not room to stream in more elements?
549+
if (bReachedLimit)
550+
{
551+
// Add to the list that might be streamed in during the final phase
552+
if ((int)ClosestStreamedOutList.size() < iMaxIn) // (only add if there is a chance it will be used)
553+
ClosestStreamedOutList.push_back(pElement);
554+
}
555+
else
556+
{
557+
// Stream in the new element. Don't do it instantly unless moved from far away.
558+
pElement->InternalStreamIn(bMovedFar);
559+
bReachedLimit = ReachedLimit();
560+
561+
if (!bReachedLimit)
562+
{
563+
iMaxIn--;
564+
if (iMaxIn <= 0)
565+
break;
570566
}
571567
}
572568
}

0 commit comments

Comments
 (0)