Sources/CryGame C++/Solution1/CryGame/XArea.cpp
//////////////////////////////////////////////////////////////////////////
//	do onexit for all areas player is in - do it before kill player

do onexit for all areas player is in - do it before kill player
do onexit for all areas player is in - do it before kill player
void	CXAreaMgr::ExitAllAreas(CXAreaUser& user)
{
	if( user.m_pEntity != user.m_pGame->GetMyPlayer() )
		return;
	for(unsigned int inIdx=0; inIdx<user.m_HostedAreasIdx.size(); inIdx++)
	{
	unsigned int aIdx;
		aIdx = user.m_HostedAreasIdx[inIdx];
		if(aIdx<m_vpAreas.size())
		{
			m_vpAreas[aIdx]->LeaveArea( user );
			user.m_HostedAreasIdx.erase( user.m_HostedAreasIdx.begin() + inIdx );
			inIdx--;
		}
	}
}
void CXAreaMgr :: ExitAllAreas ( CXAreaUser & user ) { if ( user . m_pEntity != user . m_pGame -> GetMyPlayer ( ) ) return ; for ( unsigned int inIdx = 0 ; inIdx < user . m_HostedAreasIdx . size ( ) ; inIdx ++ ) { unsigned int aIdx ; aIdx = user . m_HostedAreasIdx [ inIdx ] ; if ( aIdx < m_vpAreas . size ( ) ) { m_vpAreas [ aIdx ] -> LeaveArea ( user ) ; user . m_HostedAreasIdx . erase ( user . m_HostedAreasIdx . begin ( ) + inIdx ) ; inIdx -- ; } } }
do onexit for all areas player is in - do it before kill player
do onexit for all areas player is in - do it before kill player
// check all the areas player is in already
 // was inside, now is out - do OnLeaveArea
