Commit graph

7 commits

Author SHA1 Message Date
Ralph Sennhauser
9d791de2eb
Fix eslint rule 'prefer-const' in components/[R-S]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/[R-S]*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-12 08:02:53 +02:00
Freagarach
c3da0cdd0f Fix cosmetic ESLint warnings in JS components (and their tests).
Which were autofixable, with slight modifications.
Not done are the slightly more complex changes.

Refs. #5524
Patch by: @Krinkle
Differential revision: D2279
Comments by: @elexis, @Stan
Reviewed by: @wraitii
This was SVN commit r25087.
2021-03-20 09:02:22 +00:00
wraitii
93a352ad16 Fix UnitAI range queries - allow queries to ignore sizes - partial revert of d0fc8ff67d
Units sometimes ignored targets that entered their LoS. The cause is
d0fc8ff67d: 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-d0fc8ff67d behaviour
(entity-as-point, center-to-center range queries) and post-d0fc8ff67d
(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 7f1ee23d88, 050c5401b1 (with the exception of the iber monument
footprint), and the template changes in d0fc8ff67d 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
This was SVN commit r24776.
2021-01-23 18:57:46 +00:00
wraitii
050c5401b1 Adjust range visualisation and aura ranges following d0fc8ff67d
d0fc8ff67d / D2759 made ranges account for entity size, making auras
larger than they needed to be. This accounts for that.

Units haven't been changed, the delta is not worth modifying imo.

As discussed with Nescio, this means that, for a given aura, larger
buildings will now have a larger "aura area". This particularly affects
oblong buildings.
A proper solution for this would be to not approximate some structures
as a circle, but remains to be implemented.

Note that for current 0 A.D., this effect is unlikely to be a
significant gameplay advantage to one civilisation over another.

Reviewed By: Nescio
Differential Revision: https://code.wildfiregames.com/D3169
This was SVN commit r24349.
2020-12-08 12:53:07 +00:00
elexis
36fba76a74 Revert unintentional function rename in 40cc3aaa09.
Don't troll OOS-debugging developers with aura ranges rendered in an
invisible color, refs 5fbb224dc0 / D555.

This was SVN commit r20961.
2018-01-22 06:02:52 +00:00
elexis
d5af005a00 Expose INVALID_PLAYER to the JS simulation and use it instead of -1 for consistency with the C++ counterpart.
This was SVN commit r20953.
2018-01-22 01:02:29 +00:00
elexis
40cc3aaa09 Rename RangeVisualization component from ee5bb1fd61 / D238 to RangeOverlayManager for consistency with the RangeOverlayRenderer from 5fbb224dc0 / D555.
Refs #4899, #3915

This was SVN commit r20627.
2017-12-10 03:28:38 +00:00
Renamed from binaries/data/mods/public/simulation/components/RangeVisualization.js (Browse further)