Ticket #1827: GameView.cpp.patch

File GameView.cpp.patch, 1.1 KB (added by Maciej Piekarz, 11 years ago)
  • source/graphics/GameView.cpp

     
    773773    if (m->FollowEntity)
    774774    {
    775775        CmpPtr<ICmpPosition> cmpPosition(*(m->Game->GetSimulation2()), m->FollowEntity);
    776         if (cmpPosition && cmpPosition->IsInWorld())
     776        CmpPtr<ICmpRangeManager> cmpRangeManager(*(m->Game->GetSimulation2()), SYSTEM_ENTITY);
     777        if (cmpPosition && cmpPosition->IsInWorld() &&
     778            cmpRangeManager && cmpRangeManager->GetLosVisibility(m->FollowEntity, m->Game->GetPlayerID(), false) == ICmpRangeManager::VIS_VISIBLE)
    777779        {
    778780            // Get the most recent interpolated position
    779781            float frameOffset = m->Game->GetSimulation2()->GetLastFrameOffset();
     
    849851
    850852        CVector3D desiredPivot = pivot;
    851853
    852         CmpPtr<ICmpRangeManager> cmpRangeManager(*m->Game->GetSimulation2(), SYSTEM_ENTITY);
     854        CmpPtr<ICmpRangeManager> cmpRangeManager(*(m->Game->GetSimulation2()), SYSTEM_ENTITY);
    853855        if (cmpRangeManager && cmpRangeManager->GetLosCircular())
    854856        {
    855857            // Clamp to a circular region around the center of the map