This prevents the animator from holding a strong reference to the target unit, which was keeping the unit object alive and thus preventing the unit halo, if any, from disappearing.
This avoids a reference to the unit from being leaked, which prevented the
unit's halo (if any) from disappearing when the unit died.
Fixes#3509. Closes#3520.
The ai_helper functions are optimized for speed (as much as possible in a general setting) and do all the necessary tests. For example, get_units_with_attacks() checks both whether the unit has attacks left, and whether it has any attacks in the first place.
The relative ranking of the CA scores is not changed, except for one case when two CAs had the same score.
Reasons:
- All scores should be lower than the scores of the default Goto CA (200,000) and the default scores of most Micro AIs (300,000).
- Break tie, resulting in uncertain order of execution, of place_healers and retreat_injured CA. Healers should be placed first, to allow retreating injured units to adjacent hexes.
- Set default for generic_recruit_engine to slightly above default AI recruiting score. That way it takes effect even if the default CA is not removed.
- Increase move_to_any_enemy CA score from 1 to 1,000. It is still the lowest score that way, but allows for setting up custom CAs with even lower scores (even if it is just for end-of-turn statistics or the like).
There has been a report that some scenario would be nearly unbeatable if they
are empty in the first place, so this has the side effect of not showing the
player that he misses something. (Nevertheless, they should be hidden)
[ci skip]
- allied AI leaders, whose death causes defeat, use passive_leader=yes
- increased amount of money which the lich brothers have, if one has not the
alternative leaders who can recall units
- also increased Krash's gold to the same amount of as Eryssa has (they are the
alternative leaders)
[ci skip]
Now that all the AIs use external CAs, there is no need to use the persistent 'data' variable any more, unless information is to be exchanged between different CAs or is supposed to be persistent across save/load cycles.
Most part of the old AI had no evident effect: the dragon just
moved here and there without attacking you, and since he flied
over shallow water, it was impossible to chase him. The micro
ai makes Khrakhras wander around and attack you when you
approach his castle.
The second event took as filtered unit an ogre that has reached
the border of the map. Unfortunately, he was removed by the map
before such event was fired, causing it to never happen.
According to po comments in S1, Baldras is Harper's mother's brother.
Also change "mom"/"dad" to "mother"/"father" to match the general
medieval setting of dialogs.
Most of the Fast MAI attack utils had been taken from a more general codebase and included things not needed here. This AI is supposed to be a slimmed down version doing only the absolutely necessary in as fast as possible a fashion.