Browse Source

engine: server: add sv_allow_autoaim cvar

pull/2/head
Alibek Omarov 1 year ago
parent
commit
83d26ad233
  1. 2
      engine/server/server.h
  2. 4
      engine/server/sv_game.c
  3. 2
      engine/server/sv_main.c

2
engine/server/server.h

@ -472,6 +472,8 @@ extern convar_t sv_userinfo_penalty_multiplier; @@ -472,6 +472,8 @@ extern convar_t sv_userinfo_penalty_multiplier;
extern convar_t sv_userinfo_penalty_attempts;
extern convar_t sv_fullupdate_penalty_time;
extern convar_t sv_log_outofband;
extern convar_t sv_allow_autoaim;
extern convar_t sv_aim;
//===========================================================
//

4
engine/server/sv_game.c

@ -2385,7 +2385,9 @@ static void GAME_EXPORT pfnGetAimVector( edict_t* ent, float speed, float *rgflR @@ -2385,7 +2385,9 @@ static void GAME_EXPORT pfnGetAimVector( edict_t* ent, float speed, float *rgflR
// try all possible entities
VectorCopy( svgame.globals->v_forward, bestdir );
bestdist = Cvar_VariableValue( "sv_aim" );
if( sv_allow_autoaim.value )
bestdist = sv_aim.value;
else bestdist = 0;
check = EDICT_NUM( 1 ); // start at first client
for( i = 1; i < svgame.numEntities; i++, check++ )

2
engine/server/sv_main.c

@ -23,6 +23,7 @@ CVAR_DEFINE_AUTO( sv_lan, "0", 0, "server is a lan server ( no heartbeat, no aut @@ -23,6 +23,7 @@ CVAR_DEFINE_AUTO( sv_lan, "0", 0, "server is a lan server ( no heartbeat, no aut
CVAR_DEFINE_AUTO( sv_lan_rate, "20000.0", 0, "rate for lan server" );
CVAR_DEFINE_AUTO( sv_nat, "0", 0, "enable NAT bypass for this server" );
CVAR_DEFINE_AUTO( sv_aim, "1", FCVAR_ARCHIVE|FCVAR_SERVER, "auto aiming option" );
CVAR_DEFINE_AUTO( sv_allow_autoaim, "0", FCVAR_ARCHIVE|FCVAR_SERVER, "auto aiming option (for HL25 compatibility)" );
CVAR_DEFINE_AUTO( sv_unlag, "1", 0, "allow lag compensation on server-side" );
CVAR_DEFINE_AUTO( sv_maxunlag, "0.5", 0, "max latency value which can be interpolated (by default ping should not exceed 500 units)" );
CVAR_DEFINE_AUTO( sv_unlagpush, "0.0", 0, "interpolation bias for unlag time" );
@ -885,6 +886,7 @@ void SV_Init( void ) @@ -885,6 +886,7 @@ void SV_Init( void )
Cvar_RegisterVariable( &sv_fps );
Cvar_RegisterVariable( &showtriggers );
Cvar_RegisterVariable( &sv_aim );
Cvar_RegisterVariable( &sv_allow_autoaim );
Cvar_RegisterVariable( &deathmatch );
Cvar_RegisterVariable( &coop );
Cvar_RegisterVariable( &teamplay );

Loading…
Cancel
Save