<commit_before>//========= Copyright  1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#include "cbase.h"
#include "ios_camera.h"
#include "cdll_client_int.h"
#include "util_shared.h"
#include "prediction.h"
#include "movevars_shared.h"
#include "in_buttons.h"
#include "text_message.h"
#include "vgui_controls/controls.h"
#include "vgui/ILocalize.h"
#include "vguicenterprint.h"
#include "game/client/iviewport.h"
#include <KeyValues.h>
#include "c_match_ball.h"
#include "c_ios_mapentities.h"
#include "iinput.h"
#include "c_playerresource.h"
#include "sdk_gamerules.h"
#include "c_team.h"
#include "c_ios_replaymanager.h"
#include "tier0/vprof.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

ConVar cl_goal_opacity("cl_goal_opacity", "0.25", FCVAR_ARCHIVE, "Goal opacity when it obstructs the view");
ConVar cl_goal_opacity_fieldoffset("cl_goal_opacity_fieldoffset", "20", FCVAR_ARCHIVE, "Offset from the field end where to start making it transparent");

ConVar cl_cam_dist("cl_cam_dist", "175", FCVAR_ARCHIVE, "", true, 0, true, 175);
ConVar cl_cam_height("cl_cam_height", "20", FCVAR_ARCHIVE, "", true, -50, true, 50);
ConVar cl_cam_firstperson("cl_cam_firstperson", "0", FCVAR_ARCHIVE, "");

void CheckAutoTransparentProps(const Vector &pos, const QAngle &ang)
{
	float opacity = clamp(cl_goal_opacity.GetFloat(), 0.0f, 1.0f);

	for (int i = gpGlobals->maxClients; i <= ClientEntityList().GetHighestEntityIndex(); i++)
	{
		C_BaseEntity *pEnt = ClientEntityList().GetBaseEntity(i);
		if(!dynamic_cast<C_AutoTransparentProp *>(pEnt))
			continue;

		// Check if the camera is behind the goal line and close to the goal. Use an additional offset so the goal post doesn't get in the way.
		if (opacity != 1.0f
			&& (pos.y <= SDKGameRules()->m_vFieldMin.GetY() + cl_goal_opacity_fieldoffset.GetFloat() && pEnt->GetLocalOrigin().y < SDKGameRules()->m_vKickOff.GetY()
				|| pos.y >= SDKGameRules()->m_vFieldMax.GetY() - cl_goal_opacity_fieldoffset.GetFloat() && pEnt->GetLocalOrigin().y > SDKGameRules()->m_vKickOff.GetY())
			&& pos.x >= SDKGameRules()->m_vKickOff.GetX() - 500 && pos.x <= SDKGameRules()->m_vKickOff.GetX() + 500)
		{
			pEnt->SetRenderMode(kRenderTransColor);
			pEnt->SetRenderColorA(opacity * 255);
		}
		else
		{
			pEnt->SetRenderMode(kRenderNormal);
		}
	}<commit_msg>Change default camera height from 20 to 15<commit_after>//========= Copyright  1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#include "cbase.h"
#include "ios_camera.h"
#include "cdll_client_int.h"
#include "util_shared.h"
#include "prediction.h"
#include "movevars_shared.h"
#include "in_buttons.h"
#include "text_message.h"
#include "vgui_controls/controls.h"
#include "vgui/ILocalize.h"
#include "vguicenterprint.h"
#include "game/client/iviewport.h"
#include <KeyValues.h>
#include "c_match_ball.h"
#include "c_ios_mapentities.h"
#include "iinput.h"
#include "c_playerresource.h"
#include "sdk_gamerules.h"
#include "c_team.h"
#include "c_ios_replaymanager.h"
#include "tier0/vprof.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

ConVar cl_goal_opacity("cl_goal_opacity", "0.25", FCVAR_ARCHIVE, "Goal opacity when it obstructs the view");
ConVar cl_goal_opacity_fieldoffset("cl_goal_opacity_fieldoffset", "20", FCVAR_ARCHIVE, "Offset from the field end where to start making it transparent");

ConVar cl_cam_dist("cl_cam_dist", "175", FCVAR_ARCHIVE, "", true, 0, true, 175);
ConVar cl_cam_height("cl_cam_height", "15", FCVAR_ARCHIVE, "", true, -50, true, 50);
ConVar cl_cam_firstperson("cl_cam_firstperson", "0", FCVAR_ARCHIVE, "");

void CheckAutoTransparentProps(const Vector &pos, const QAngle &ang)
{
	float opacity = clamp(cl_goal_opacity.GetFloat(), 0.0f, 1.0f);

	for (int i = gpGlobals->maxClients; i <= ClientEntityList().GetHighestEntityIndex(); i++)
	{
		C_BaseEntity *pEnt = ClientEntityList().GetBaseEntity(i);
		if(!dynamic_cast<C_AutoTransparentProp *>(pEnt))
			continue;

		// Check if the camera is behind the goal line and close to the goal. Use an additional offset so the goal post doesn't get in the way.
		if (opacity != 1.0f
			&& (pos.y <= SDKGameRules()->m_vFieldMin.GetY() + cl_goal_opacity_fieldoffset.GetFloat() && pEnt->GetLocalOrigin().y < SDKGameRules()->m_vKickOff.GetY()
				|| pos.y >= SDKGameRules()->m_vFieldMax.GetY() - cl_goal_opacity_fieldoffset.GetFloat() && pEnt->GetLocalOrigin().y > SDKGameRules()->m_vKickOff.GetY())
			&& pos.x >= SDKGameRules()->m_vKickOff.GetX() - 500 && pos.x <= SDKGameRules()->m_vKickOff.GetX() + 500)
		{
			pEnt->SetRenderMode(kRenderTransColor);
			pEnt->SetRenderColorA(opacity * 255);
		}
		else
		{
			pEnt->SetRenderMode(kRenderNormal);
		}
	}
{'fraction_non_alphanumeric': 0.18677986658580958, 'fraction_numerical': 0.018597129573478876, 'mean_word_length': 5.7228260869565215, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4203094', 'n_tokens_mistral': 1920, 'n_tokens_neox': 1762, 'n_words': 379}