# HG changeset patch
# User geNia
# Date 1599584203 14400
#      Tue Sep 08 12:56:43 2020 -0400
# Node ID df31378d95bebc053d281c8fdb6b56608068a917
# Parent  61393f3baeebdc077e6007e7499ff22d722ed44c
Don't reset fov upon respawn

diff -r 61393f3baeeb -r df31378d95be src/c_cmds.cpp
--- a/src/c_cmds.cpp	Mon Sep 07 18:37:30 2020 -0400
+++ b/src/c_cmds.cpp	Tue Sep 08 12:56:43 2020 -0400
@@ -1078,9 +1078,14 @@
 	}
 	else
 	{
-		// Just do this here in client games.
-		if ( NETWORK_GetState( ) == NETSTATE_CLIENT )
-			player->DesiredFOV = static_cast<float> ( clamp (atoi (argv[1]), 5, 179) );
+		// Just do this here in client games.
+		if (NETWORK_GetState() == NETSTATE_CLIENT)
+		{
+			player->DesiredFOV = static_cast<float> (clamp(atoi(argv[1]), 5, 179));
+			UCVarValue Value;
+			Value.Float = player->DesiredFOV;
+			cl_fov.ForceSet(Value, CVAR_Float);
+		}
 
 		Net_WriteByte (DEM_MYFOV);
 	}
diff -r 61393f3baeeb -r df31378d95be src/cl_main.cpp
--- a/src/cl_main.cpp	Mon Sep 07 18:37:30 2020 -0400
+++ b/src/cl_main.cpp	Tue Sep 08 12:56:43 2020 -0400
@@ -3511,7 +3511,7 @@
 		pActor->sprite = skins[lSkin].sprite;
 	}
 
-	pPlayer->DesiredFOV = pPlayer->FOV = 90.f;
+	pPlayer->DesiredFOV = pPlayer->FOV = cl_fov;
 	// If the console player was watching another player in demo mode, continue to follow
 	// that other player.
 	if ( pCameraActor )
@@ -9302,7 +9302,8 @@
 // the last used passwords to all servers it connects to.
 CVAR( String, cl_password, "password", 0 )
 CVAR( String, cl_joinpassword, "password", 0 )
-CVAR( Bool, cl_hitscandecalhack, true, CVAR_ARCHIVE )
+CVAR( Bool, cl_hitscandecalhack, true, CVAR_ARCHIVE )
+CVAR( Float, cl_fov, 90, CVAR_ARCHIVE | CVAR_NOSET )
 
 //*****************************************************************************
 //	STATISTICS
diff -r 61393f3baeeb -r df31378d95be src/cl_main.h
--- a/src/cl_main.h	Mon Sep 07 18:37:30 2020 -0400
+++ b/src/cl_main.h	Tue Sep 08 12:56:43 2020 -0400
@@ -210,7 +210,8 @@
 EXTERN_CVAR( Flag, cl_dontrestorefrags )
 EXTERN_CVAR( String, cl_password )
 EXTERN_CVAR( String, cl_joinpassword )
-EXTERN_CVAR( Bool, cl_hitscandecalhack )
+EXTERN_CVAR( Bool, cl_hitscandecalhack )
+EXTERN_CVAR( Float, cl_fov )
 
 // Not in cl_main.cpp, but this seems like a good enough place for it.
 EXTERN_CVAR( Int, cl_skins )
