0ad/source/simulation2
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
..
components Prevent targeting unreachable turreted entities 2026-08-12 22:40:59 +02:00
docs Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
helpers Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
scripting Remove global g_xres and x_yres 2026-07-08 11:35:46 +02:00
serialization Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
system Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
tests Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
MessageTypes.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
Simulation2.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
Simulation2.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
TypeList.h Store whether a player is activ in C++ 2025-01-05 19:57:12 +01:00