HomeWildfire Games

Fix UnitAI range queries - allow queries to ignore sizes - partial revert of…

Description

Fix UnitAI range queries - allow queries to ignore sizes - partial revert of rP24217

Units sometimes ignored targets that entered their LoS. The cause is rP24217: range queries returned units farther away, and those units might actually be out of range if distance is computed center-to-center, which both UnitAI and LOS do. This meant that code relying on range query updates was possibly broken, and indeed units missed things (see ticket).

This introduces a boolean to switch between pre-rP24217 behaviour (entity-as-point, center-to-center range queries) and post-rP24217 (entities-as-circumscribing-circle, edge-to-edge range queries).
The former is used for UnitAI (where the new behaviour bugged), auras (where varying structure sizes made it awkward) and build restrictions(which simply did not really need it).

Reverts rP24643, rP24349 (with the exception of the iber monument footprint), and the template changes in rP24217 itself.

It also reduces alertRaiser ranges slightly, this was missed in the original diff.

#3381 is not reopened as BuildingAI still uses the new range queries.

Reported by: Freagarach

Comments By: Angen

Fixes #5968

Differential Revision: https://code.wildfiregames.com/D3456