Skip to content

Commit

Permalink
fix #5969
Browse files Browse the repository at this point in the history
out-of-range targets were already being included in the candidate
set for weapons with non-zero heightmods, which was not a problem
until the introduction of autoTargetRangeBoost

together with 7723ade (unboosted)
weapons now behave as before and can no longer select such targets
  • Loading branch information
rt committed Apr 30, 2018
1 parent d987965 commit 4bab202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rts/Sim/Weapons/Weapon.cpp
Expand Up @@ -660,7 +660,7 @@ bool CWeapon::AutoTarget()

// set isAutoTarget s.t. TestRange result is ignored
// (which enables pre-aiming at targets out of range)
if (!TryTarget(SWeaponTarget(unit, false, true)))
if (!TryTarget(SWeaponTarget(unit, false, autoTargetRangeBoost > 0.0f)))
continue;

if (unit->IsNeutral() && (owner->fireState < FIRESTATE_FIREATNEUTRAL))
Expand Down

0 comments on commit 4bab202

Please sign in to comment.