@@ -55,6 +55,8 @@ ConVar joy_disable_movement_in_ui( "joy_disable_movement_in_ui", "1", FCVAR_NONE
5555ConVar rd_input_controller_mode_mouse ( " rd_input_controller_mode_mouse" , " -1" , FCVAR_NONE );
5656ConVar rd_input_controller_mode_keyboard ( " rd_input_controller_mode_keyboard" , " -1" , FCVAR_NONE );
5757
58+ ConVar rd_limit_aim_top_offset ( " rd_limit_aim_top_offset" , " 50" , FCVAR_NONE, " Ignore aim targets this many units from below the camera and higher" );
59+
5860extern kbutton_t in_attack;
5961extern kbutton_t in_walk;
6062extern int g_asw_iPlayerListOpen;
@@ -464,7 +466,7 @@ C_BaseEntity* HUDToWorld(float screenx, float screeny,
464466 Vector vecAlienPos = pBestAlien->GetAimTargetRadiusPos ( vecWeaponPos );
465467
466468 // Don't aim at stuff a bit below camera and higher
467- if ( vecAlienPos.z > vCameraLocation.z - 50 . 0f )
469+ if ( vecAlienPos.z > vCameraLocation.z - rd_limit_aim_top_offset. GetFloat () )
468470 {
469471 pBestAlien = NULL ;
470472 }
@@ -519,7 +521,8 @@ C_BaseEntity* HUDToWorld(float screenx, float screeny,
519521 continue ;
520522
521523 // Don't aim at stuff a bit below camera and higher
522- if ( pPlayer->GetASWControls () == ASWC_TOPDOWN && vecAlienPos.z > vCameraLocation.z - 50 .0f )
524+ if ( pPlayer->GetASWControls () == ASWC_TOPDOWN &&
525+ vecAlienPos.z > vCameraLocation.z - rd_limit_aim_top_offset.GetFloat () )
523526 continue ;
524527
525528 Vector vDirection = vecAlienPos - vecWeaponPos;
0 commit comments