0ad/binaries/data/mods/public/simulation/components/tests
Atrik fc3c0d7876 Prevent targeting unreachable turreted entities
Introduce CanEverReachTarget in the Attack component to check whether
a target is geometrically reachable at all, accounting for height
offsets and turreted units inside buildings.

For non-parabolic attacks (e.g. melee), a simple 3D distance check
from the closest approach point is used.

For parabolic attacks (e.g. ranged), the parabolic range formula
is used to determine if the height difference is surmountable
from the closest horizontal distance to the target.

Add GetClosestApproachDistanceToTurretPoint to TurretHolder
to estimate the minimum horizontal distance to a turret point,
using its local offset and the holder's obstruction size.
Passable buildings are not considered obstacles.

Fixes units on the ground trying to attack unreachable units on walls
or towers when the projectile's arc cannot reach the required height.
2026-08-12 22:40:59 +02:00
..
setup.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
setup_test.js Fix eslint rule 'prefer-const' in components/tests 2025-05-11 10:03:30 +02:00
test_Attack.js Prevent targeting unreachable turreted entities 2026-08-12 22:40:59 +02:00
test_Auras.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_AutoBuildable.js Allow buildings to autobuild themselves. 2020-02-25 21:29:07 +00:00
test_Barter.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Builder.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_BuildRestrictions.js Fix broken build restrictions 2025-05-31 10:58:14 +02:00
test_Capturable.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Damage.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_DeathDamage.js Fix eslint rule 'prefer-const' in components/tests/[A-R]* 2025-05-11 09:06:57 +02:00
test_Diplomacy.js Fix eslint rule 'semi' 2025-05-03 14:13:14 +02:00
test_EndGameManager.js Fix eslint rule 'prefer-const' in components/tests/[A-R]* 2025-05-11 09:06:57 +02:00
test_EntityLimits.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Formation.js Add unit tests for multi-level class sorting 2026-01-23 17:20:11 +01:00
test_Foundation.js Fix renamed entities on TurretPoint 2026-02-04 11:05:07 +01:00
test_Garrisonable.js Fix eslint rule 'prefer-const' in components/tests/[A-R]* 2025-05-11 09:06:57 +02:00
test_GarrisonHolder.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Garrisoning.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Gate.js Fix eslint rule 'prefer-const' in components/tests/[A-R]* 2025-05-11 09:06:57 +02:00
test_GuiInterface.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Heal.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Health.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Identity.js Add Requirements helper. 2022-11-24 11:20:11 +00:00
test_Loot.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Looter.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Math.js Fix cosmetic ESLint warnings in JS components (and their tests). 2021-03-20 09:02:22 +00:00
test_ModifiersManager.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Pack.js Fix renamed entities on TurretPoint 2026-02-04 11:05:07 +01:00
test_Player.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Population.js Enable eslint rule 'no-useless-assignment' 2025-08-01 11:26:40 +02:00
test_PopulationCapManager.js Move globals to the PopCapManager prototype. 2025-07-27 19:00:04 +02:00
test_ProductionQueue.js Don't set animation for production with UnitAi 2025-10-07 19:25:21 +02:00
test_Promotion.js Fix eslint rule 'prefer-const' in components/tests/[A-R]* 2025-05-11 09:06:57 +02:00
test_RallyPoint.js Allow players to set rally points on allied buildings 2026-06-10 00:09:48 +02:00
test_Researcher.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Resistance.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_ResourceDropsite.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_ResourceGatherer.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Resources.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_ResourceSupply.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_ResourceTrickle.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_StatisticsTracker.js Fix eslint rule 'prefer-const' in components/tests 2025-05-11 10:03:30 +02:00
test_StatusEffectsReceiver.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Technologies.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_TechnologyManager.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Timer.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Trader.js Fix eslint indent rule 2025-05-03 09:39:58 +02:00
test_Trainer.js Fix Trainer-ProductionQueue sync OnOwnershipChange 2026-02-17 16:07:24 +01:00
test_Treasure.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_TreasureCollector.js Fix eslint rule 'prefer-const' in components/tests 2025-05-11 10:03:30 +02:00
test_Treasures.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_TurretHolder.js Fix renamed entities on TurretPoint 2026-02-04 11:05:07 +01:00
test_Turrets.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_UnitAI.js Add tests for SelectionBoxTargeting 2026-07-30 17:19:39 +02:00
test_UnitMotionFlying.js Fix eslint rule 'no-return-assign' 2025-05-13 20:12:35 +02:00
test_UpgradeModification.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Upkeep.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_ValueModificationHelper.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00
test_Vector.js Fix eslint rule 'prefer-const' in components/tests 2025-05-11 10:03:30 +02:00
test_VisionSharing.js Use @stylistic/brace-style for eslint 2026-01-12 21:33:52 +01:00