1
0
forked from 0ad/0ad
0ad/binaries/data/mods/public/globalscripts
wraitii cce7d02036 Bugfix & optimisations to ApplyModifiers
This functions is amongst the most called in JS, so it's important to
make it speedy.

- Bugfix: if 'originalValue' is falsy, the result was never cached. This
in particular affected the minRange of archers, which is 0. It's a large
optimisation on combatDemoHuge, but the effect elsewhere is less likely
to be noticeable.
- Don't go through the helper to get the player Entity ID, in this case
it's slower.
- Concat is slower than Flat() in this case according to my profiling.
- Some micro-optimisation by strict equality.

Differential Revision: https://code.wildfiregames.com/D5012
This was SVN commit r27696.
2023-06-14 07:27:06 +00:00
..
tests Generalize fromInitAttributes loop 2022-03-06 21:01:36 +00:00
AttackEffects.js Fix sound not played when being attacked by non-capture attacks. 2021-01-19 07:22:27 +00:00
DamageTypes.js Fix translation of damage types. 2021-04-15 05:47:54 +00:00
Formation.js Allow picking a default formation for walk (and walk-like) orders. 2020-12-31 10:04:58 +00:00
FSM.js Move custom JS data structures to globalscripts. 2021-04-18 08:31:30 +00:00
interpolation.js Fix more JsDocs numbers/bools/strings 2020-08-24 11:50:31 +00:00
Math.js Use https in hyperlinks for sites that support it, refs #5257. 2018-08-23 09:23:06 +00:00
ModificationTemplates.js Apply modifiers from civ/team bonus auras in Reference Suite 2021-06-08 23:35:44 +00:00
MultiKeyMap.js Move custom JS data structures to globalscripts. 2021-04-18 08:31:30 +00:00
random.js Add randomAngle helper function to abbreviate calls. 2018-01-15 14:20:57 +00:00
Resources.js Split treasures from ResourceSupply. 2021-03-03 07:47:38 +00:00
StatusEffects.js Small fixes for status effects 2021-01-10 09:54:12 +00:00
Technologies.js Allow modifiers without "affects" list. 2021-03-29 08:10:08 +00:00
Templates.js Bugfix & optimisations to ApplyModifiers 2023-06-14 07:27:06 +00:00
Trade.js Adapt trade gain normalization to map size (increased on small maps and decreased on large maps), and slow down the increase of the gain at very large distances. 2017-10-31 17:52:08 +00:00
utility.js Generalize fromInitAttributes loop 2022-03-06 21:01:36 +00:00
vector.js Adds snapping to edges for buildings 2020-01-05 01:08:05 +00:00
WeightedList.js Move custom JS data structures to globalscripts. 2021-04-18 08:31:30 +00:00