Sources/CryGame C++/Solution1/CryGame/XArea.cpp
//////////////////////////////////////////////////////////////////////////
//	checks for areas in the same group, if entered area is lower priority (areaID) - return false 
//	(don't do enreArea for it)

checks for areas in the same group, if entered area is lower priority (areaID) - return false
(don't do enreArea for it)
checks for areas in the same group if entered area is lower priority ( areaID ) - return false ( don ' t do enreArea for it )
void	CXAreaMgr::ProceedExclusiveUpdate( CXAreaUser& user, unsigned int curIdx )
{
	int	maxArea=FindHighestHostedArea( user.m_HostedAreasIdx, curIdx );
	CXArea *firstArea=m_vpAreas[curIdx];
	if( maxArea<0 )
	{
		firstArea->UpdateArea(user);
		return;
	}
	CXArea *secondArea=m_vpAreas[maxArea];
	if( firstArea->GetID()<secondArea->GetID() )
	{
		firstArea = secondArea;
		int	secondMaxArea=FindHighestHostedArea( user.m_HostedAreasIdx, maxArea );
		secondArea=m_vpAreas[secondMaxArea];
	}
	float fadeBase = firstArea->CalculateFade(user.m_vPos);
	if( fadeBase<1.0f )
	{
		if( !secondArea->m_bIsActive )
			secondArea->EnterArea(user);
		float fadeSecond = secondArea->CalculateFade(user.m_vPos);
		fadeSecond *= (1.0f-fadeBase);
		firstArea->ProceedFade(user, fadeBase);
		secondArea->ProceedFade(user, fadeSecond);
	}
	else
	{
		if( secondArea->m_bIsActive )
			secondArea->LeaveArea(user);
	}
	int curGroup = m_vpAreas[curIdx]->GetGroup();
	for(unsigned int inIdx=0; inIdx<user.m_HostedAreasIdx.size(); inIdx++)
	{
		unsigned int aIdx = user.m_HostedAreasIdx[inIdx];
		if( aIdx>=m_vpAreas.size() )
			continue;
		if(m_vpAreas[curIdx]->GetGroup() != m_vpAreas[aIdx]->GetGroup())
			continue;
		m_vpAreas[aIdx]->m_stepID = 0;
	}
}
void CXAreaMgr :: ProceedExclusiveUpdate ( CXAreaUser & user , unsigned int curIdx ) { int maxArea = FindHighestHostedArea ( user . m_HostedAreasIdx , curIdx ) ; CXArea * firstArea = m_vpAreas [ curIdx ] ; if ( maxArea < 0 ) { firstArea -> UpdateArea ( user ) ; return ; } CXArea * secondArea = m_vpAreas [ maxArea ] ; if ( firstArea -> GetID ( ) < secondArea -> GetID ( ) ) { firstArea = secondArea ; int secondMaxArea = FindHighestHostedArea ( user . m_HostedAreasIdx , maxArea ) ; secondArea = m_vpAreas [ secondMaxArea ] ; } float fadeBase = firstArea -> CalculateFade ( user . m_vPos ) ; if ( fadeBase < 1.0f ) { if ( ! secondArea -> m_bIsActive ) secondArea -> EnterArea ( user ) ; float fadeSecond = secondArea -> CalculateFade ( user . m_vPos ) ; fadeSecond *= ( 1.0f - fadeBase ) ; firstArea -> ProceedFade ( user , fadeBase ) ; secondArea -> ProceedFade ( user , fadeSecond ) ; } else { if ( secondArea -> m_bIsActive ) secondArea -> LeaveArea ( user ) ; } int curGroup = m_vpAreas [ curIdx ] -> GetGroup ( ) ; for ( unsigned int inIdx = 0 ; inIdx < user . m_HostedAreasIdx . size ( ) ; inIdx ++ ) { unsigned int aIdx = user . m_HostedAreasIdx [ inIdx ] ; if ( aIdx >= m_vpAreas . size ( ) ) continue ; if ( m_vpAreas [ curIdx ] -> GetGroup ( ) != m_vpAreas [ aIdx ] -> GetGroup ( ) ) continue ; m_vpAreas [ aIdx ] -> m_stepID = 0 ; } }
checks for areas in the same group, if entered area is lower priority (areaID) - return false
(don't do enreArea for it)
checks for areas in the same group if entered area is lower priority ( areaID ) - return false ( don ' t do enreArea for it )
// not grouped or the only one in a group
 // mark all the areas of this group as updated
 //safecheck for editor
