Skip to content

Commit aad7bdb

Browse files
committed
fix(aiming): don't aim at stuff a bit below camera and higher in topdown
1 parent f89154b commit aad7bdb

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/game/client/swarm/asw_input.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,19 @@ C_BaseEntity* HUDToWorld(float screenx, float screeny,
457457
if (asw_DebugAutoAim.GetBool())
458458
ASW_StoreClearAll();
459459

460+
// Check bad aim angles
461+
if ( pPlayer->GetASWControls() == ASWC_TOPDOWN &&
462+
!ASWInput()->ControllerModeActiveMouse() && pBestAlien )
463+
{
464+
Vector vecAlienPos = pBestAlien->GetAimTargetRadiusPos( vecWeaponPos );
465+
466+
// Don't aim at stuff a bit below camera and higher
467+
if ( vecAlienPos.z > vCameraLocation.z - 60.0f )
468+
{
469+
pBestAlien = NULL;
470+
}
471+
}
472+
460473
// if we have our cursor over a target (and not using the controller), make sure we have LOS to him before we continue
461474
if ( !ASWInput()->ControllerModeActiveMouse() && pBestAlien )
462475
{
@@ -505,6 +518,10 @@ C_BaseEntity* HUDToWorld(float screenx, float screeny,
505518
if ( vecAlienPos.DistToSqr(vecWeaponPos) > ASW_MAX_AUTO_AIM_RANGE )
506519
continue;
507520

521+
// Don't aim at stuff a bit below camera and higher
522+
if ( pPlayer->GetASWControls() == ASWC_TOPDOWN && vecAlienPos.z > vCameraLocation.z - 60.0f )
523+
continue;
524+
508525
Vector vDirection = vecAlienPos - vecWeaponPos;
509526
float fZDist = vDirection.z;
510527
if ( fZDist > 250.0f )

0 commit comments

Comments
 (0)