Sources/CryGame C++/Solution1/CryGame/GameMisc.cpp
// changes in and out of third person
//////////////////////////////////////////////////////////////////////////

changes in and out of third person
changes in and out of third person
void CXGame::SetViewMode(bool bThirdPerson)
{
	if (GetMyPlayer())
	{
		CPlayer *pPlayer;
		if (GetMyPlayer()->GetContainer()->QueryContainerInterface(CIT_IPLAYER,(void**)&pPlayer))
		{
			if (pPlayer->m_stats.aiming)
				return;
			if(!IsDevModeEnable() && bThirdPerson && !pPlayer->GetVehicle())
				return;
			pPlayer->m_bFirstPerson = !bThirdPerson;
			pPlayer->GetEntity()->DrawCharacter(0,ETY_DRAW_NORMAL);
			pPlayer->SetViewMode(bThirdPerson);
		}
	}
}
void CXGame :: SetViewMode ( bool bThirdPerson ) { if ( GetMyPlayer ( ) ) { CPlayer * pPlayer ; if ( GetMyPlayer ( ) -> GetContainer ( ) -> QueryContainerInterface ( CIT_IPLAYER , ( void * * ) & pPlayer ) ) { if ( pPlayer -> m_stats . aiming ) return ; if ( ! IsDevModeEnable ( ) && bThirdPerson && ! pPlayer -> GetVehicle ( ) ) return ; pPlayer -> m_bFirstPerson = ! bThirdPerson ; pPlayer -> GetEntity ( ) -> DrawCharacter ( 0 , ETY_DRAW_NORMAL ) ; pPlayer -> SetViewMode ( bThirdPerson ) ; } } }
changes in and out of third person
changes in and out of third person
// prevent player from going into third person mode when he is aiming
 // disable third person view when not in vehicle AND not in devmode
 // don't hide player - need to call CPlayer::OnDraw always for mounted weapons
 // use pPlayer->m_bFirstPerson to avoid drawing player
