The used names was never set so the check for duplicated names did not
work. Detected by cppcheck.
(cherry-picked from commit cc98bcd9d015a852dbec2053f300ce4682c4765d)
Certain distro/compiler combinations will apparently warn about not optimizing when _FORTIFY_SOURCE is set.
(cherry-picked from commit 09fcc6b0519d458cbc3e16788576000a8484020b)
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.
(cherry-picked from commit e63bd35f9d209f355400a743732ea2c4b91d5da4)
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.
(cherry-picked from commit 75843541bcf92e743b911ef49046c54a050e8a0f)
One must compile wesnoth with -DLOCALEDIR=/usr/share/locale, as that's the place
where the system looks for translations.
(One can test it with gettext -s -d wesnoth "poisoned")
This is according to the docs, needs more testing if it works.
Doesn't work with Arch, though Arch doesn't support software centres well.
[ci skip]
(cherry-picked from commit 60f2158dfaa88eca47e4f2bdb0a4a64f28db8ba1)
ai_helper.robust_move_and_attack() does the stop_unit_moves automatically if the unit is at the destination hex.
(cherry-picked from commit fdc3249496e7c2418a8ab8c7ec19b85bba3f79fb)
They are as well used in the software centre.
Having keywords is a bonus, even if they are not matched.
[ci skip]
(cherry-picked from commit 76e7c8d19f8626dca5edd33b8c66ef3a0385f93f)
see https://github.com/wesnoth/wesnoth/issues/3240
Just fixing the crash, not sure how the code should behave in this case, it would be nice if someone who knows more about the ai code would either implement that todo or remove the second warning. An alternative fix would be to move the 'calculate_moves' inside the ai_leaders loop.
(cherry-picked from commit 18526e499a082d849295f0db93cdc9b5ea223df7)
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).
(cherry-picked from commit 35ba82050954c2cee86321e05d6706993c08e143)
So that it is possible to use the recruit_rushers CA without the castle_switch CA.
(cherry-picked from commit 0bcb98cf5026710871d8b90919752c90808c56d0)
the one usage of type is left deliberately, to point out that it affects 3
instad of 2 or 4 types.
[ci skip]
(cherry-picked from commit ce056894dab0285fb7596deb69445a1184a9cd19)
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]
(cherry-picked from commit 47c3947d0aa651fd32545d6292d5cfed9fd02864)
- 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]
(cherry-picked from commit 79993ea601f34d07aa7f26251bc87b52da4338de)
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.
(cherry-picked from commit 3bfd59f28ba7f70a6ac32782e98cba9ca6c2a44a)
They cannot be set for the MAI, and they would have to be set through 'cfg' not 'data' anyway.
(cherry-picked from commit 62625fd5e2821472181c53932ffe7f6b264373c5)
... for consistency with the previous message stating that
all orcs are killed by the elves.
(cherry-picked from commit 34f417c4eb488966a779bcfa9a0e32f933d3960e)
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.
(cherry-picked from commit 64917b70b5eb484ed132df2b43ca26b3af47a690)
Also adds a new objective in S16, which was not stated but
actually makes you win.
(cherry-picked from commit 50e4cc5d3fddc7f7d47c9437b3133567aa0e3dde)
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.
(cherry-picked from commit 643f1336dd92982850b4f61b9af6ce2d6a8c5d77)
This happens when the list comes up empty because of a non-matching
filter, e.g. "Elvish Archer222" and the user clicks on one of the gender
options in this state.
Ideally we should clear the preview pane and disable the options and OK
button here, but the former appears impossible and for some reason
changing the pane's visibility in filter_text_changed() doesn't work
reliably.
(cherry-picked from commit 26629d4a621b74e90513842db577d5bd03a415de)
It probably doen't make a noticeable difference for these AIs, but in general we should not call the slow functions more than necessary.
(cherry-picked from commit 42b443084125ab7a989465e5f7f19835a17ba85b)
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.
(cherry-picked from commit bcb6153b89edafc15453358b5754f6e34f39b830)